Is the default behavior for the grid to remove row before firing the remove event? If so is there a beforeRemove event I can use?
I'm trying to implement my own confirm, for deleting. I have seen some of the other examples on here but I would prefer to write as little
custom code as possible since there will be a lot of grids in my project that will all use this functionality.
so far I have this
$kendoGrid.bind("remove", gridRemoveRow);
var gridRemoveRow = function (e) {
e.preventDefault();
app.showMessage("Are you sure you want to delete this row?", "Delete Row", ["Yes", "No"]).then(function (result) {
if (result == "Yes") {
$kendoGrid.dataSource.remove(e.model)
$kendoGrid.dataSource.sync()
}
else
$kendoGrid.cancelChanges();
});
};
This code works, but the behavior of removing the row before it gets to gridRemoveRow could cause some confusion for the user with thinking they clicked the wrong row or that the delete already happened.
I'm trying to implement my own confirm, for deleting. I have seen some of the other examples on here but I would prefer to write as little
custom code as possible since there will be a lot of grids in my project that will all use this functionality.
so far I have this
$kendoGrid.bind("remove", gridRemoveRow);
var gridRemoveRow = function (e) {
e.preventDefault();
app.showMessage("Are you sure you want to delete this row?", "Delete Row", ["Yes", "No"]).then(function (result) {
if (result == "Yes") {
$kendoGrid.dataSource.remove(e.model)
$kendoGrid.dataSource.sync()
}
else
$kendoGrid.cancelChanges();
});
};
This code works, but the behavior of removing the row before it gets to gridRemoveRow could cause some confusion for the user with thinking they clicked the wrong row or that the delete already happened.