Added ability to delete Corrective Actions through the list page.

This commit is contained in:
Daniel Wathen
2023-02-13 15:12:18 -07:00
parent bf59afdc1b
commit 09543b8474
6 changed files with 27 additions and 10 deletions

View File

@ -1,4 +1,4 @@
@{
@{
Layout = "_HomeLayout.cshtml";
}
@ -37,6 +37,7 @@
columns.Bound(l => l.PendingAIOwners).Width("100px").Title("Action Item Owners");
columns.Bound(l => l.D8DueDate).Format("{0:MM/dd/yy}").Width("100px");
columns.Bound(l => l.ClosedDate).Format("{0:MM/dd/yy}").Width("100px");
columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"<a href='javascript: void(0)' class='abutton delete' onclick='deleteRowCA(this)' title='button delete'>button delete</a>");
})
@ -68,14 +69,14 @@
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.CANo);
{
model.Id(p => p.CANo);
//model.Field(p => p.TotalCost).Editable(false);
})
//model.Field(p => p.TotalCost).Editable(false);
})
.PageSize(50)
.Read(read => read.Action("GetCorrectiveActionList", "Home"))
//.Destroy(destroy => destroy.Action("DeleteItem", "Home"))
.Destroy(destroy => destroy.Action("DeleteItem", "Home"))
)
)
</div>
@ -93,5 +94,8 @@
return numStr;
}
</script>
function deleteRowCA(element) {
grid = $("#CAList").data("kendoGrid");
grid.removeRow($(element).closest("tr"));
}
</script>