104 lines
4.7 KiB
Plaintext
104 lines
4.7 KiB
Plaintext
@{
|
|
Layout = "_HomeLayout.cshtml";
|
|
}
|
|
|
|
@{
|
|
ViewBag.Title = "Corrective Action List";
|
|
}
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<table style="width: 100%">
|
|
<tr>
|
|
<td align="center" style="font-size: 15px; font-weight: bold; color: crimson">
|
|
Corrective Action List
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="auditListdiv" class="k-content" style="font-size: 11px">
|
|
|
|
|
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.CorrectiveAction>()
|
|
.Name("CAList")
|
|
.Columns(columns =>
|
|
{
|
|
|
|
columns.Bound(l => l.CANo)
|
|
.ClientTemplate("<a href='/CorrectiveAction/Edit?IssueID=#=CANo#'>#=formatIssueID(CANo)#</a>");
|
|
|
|
columns.Bound(l => l.CASource);
|
|
columns.Bound(l => l.RequestorName).Title("Requestor");
|
|
columns.Bound(l => l.D1AssigneeName).Title("Assignee");
|
|
columns.Bound(l => l.IssueDate).Format("{0:MM/dd/yy}");
|
|
columns.Bound(l => l.CATitle);
|
|
columns.Bound(l => l.StatusName);
|
|
columns.Bound(l => l.PendingApprovers);
|
|
columns.Bound(l => l.PendingAIOwners).Title("Action Item Owners");
|
|
columns.Bound(l => l.D8DueDate).Format("{0:MM/dd/yy}");
|
|
columns.Bound(l => l.NextDueDate).Format("{0:MM/dd/yy}");
|
|
columns.Bound(l => l.ClosedDate).Format("{0:MM/dd/yy}");
|
|
if ((bool)Session[GlobalVars.IS_ADMIN])
|
|
columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"<a href='javascript: void(0)' class='abutton delete' onclick='deleteRowCA(this)' title='button delete'>button delete</a>");
|
|
|
|
})
|
|
|
|
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
|
|
.Editable(editable => editable.Mode(GridEditMode.InLine))
|
|
.HtmlAttributes(new { style = "height:700px; width:100%; font-size: 11px" })
|
|
.Scrollable()
|
|
.Sortable()
|
|
.Resizable(r => r.Columns(true))
|
|
.Filterable(filterable => filterable
|
|
.Extra(false)
|
|
.Operators(operators => operators
|
|
.ForString(str => str
|
|
.Clear()
|
|
.Contains("Contains")
|
|
.DoesNotContain("Does not contain")
|
|
.StartsWith("Starts with")
|
|
.EndsWith("Ends with")
|
|
.IsEqualTo("Is equal to")
|
|
.IsNotEqualTo("Is not equal to ")
|
|
)
|
|
)
|
|
)
|
|
.Pageable(pageable => pageable
|
|
.Refresh(true)
|
|
.PageSizes(true)
|
|
.ButtonCount(5))
|
|
|
|
.DataSource(dataSource => dataSource
|
|
.Ajax()
|
|
.Model(model =>
|
|
{
|
|
model.Id(p => p.CANo);
|
|
|
|
//model.Field(p => p.TotalCost).Editable(false);
|
|
})
|
|
.PageSize(50)
|
|
.Read(read => read.Action("GetCorrectiveActionList", "Home"))
|
|
.Destroy(destroy => destroy.Action("DeleteCAItem", "Home"))
|
|
)
|
|
)
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function formatIssueID(num) {
|
|
var length = 5;
|
|
var numStr = num.toString();
|
|
while (numStr.length < length) {
|
|
numStr = '0' + numStr;
|
|
}
|
|
|
|
numStr = 'C' + numStr
|
|
return numStr;
|
|
}
|
|
|
|
function deleteRowCA(element) {
|
|
grid = $("#CAList").data("kendoGrid");
|
|
grid.removeRow($(element).closest("tr"));
|
|
}
|
|
</script>
|