Hi,
My requirement is on click of any delete button it should delete all the rows based on Allocation Date.
Suppose if the user clicks on 1st row delete button then for the Allocation Date 10/31/2024, it has two records so it should delete the first two rows.
The below method calls on click of delete button. The server side code deletes the first two rows based on the Allocation Date , but the
below DeleteRecord method only remove one row and sync the grid. It won't remove the 2nd row till we have to refresh the browser.
function DeleteRecord(e) {
var grid = '';
var tr = $(e.target).closest("tr"); //get the row for deletion
var data = this.dataItem(tr);
var confirmDialog = $('<div />').kendoConfirm({
content: "Are you sure want to delete this record? This will delete all records for the selected Allocation Date",
title: "Please confirm"
}).data('kendoConfirm').open();
confirmDialog.result.then(function () {
grid = $("#TLPCurveAllocationsGrid").data("kendoGrid");
grid.dataSource.remove(data); //prepare a "destroy" request
grid.dataSource.sync(); //actually send the request (might be ommited if the autoSync option is enabled in the dataSource)
$("#TLPCurveAllocationsGrid").data("kendoGrid").dataSource.read();
}, function () {
//do nothing
});
}