Hi,
I have a grid in batch edit mode. The grid is using a local data source. It has a custom template for a command button which becomes visible if the row's data item is dirty. This is working fine. My problem is I'd like to roll-back that data item to its initial state when the button is clicked regardless of whether the row is in edit mode or not.
This is the event that fires when the undo button is clicked.
var theGrid = $("#layersGrid").data("kendoGrid");
theGrid.table.on('click', '.undo-button', function (e) {
setToInitialState.call(theGrid, e);
});
function setToInitialState(e) {
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
}
How do I revert the data item to its initial state ?
Thank you.