Hi Andrew,
Thanks for contacting Syncfusion support.
Query: Is there a way to programatically check with JS / jQuery if the grid data has been changed? I want to call batchSave() externally only when there are changes. batchEdit is enabled
You can achieve your requirement by using getBatchChanges() method of Grid which returns the currently edited records details of batch edit. Based on returned value, you can execute the batchSave method if any changes applied in the Grid.
<script>
function btnClick(args) {
var grid = document.getElementById('Grid').ej2_instances[0];
// get the batch changed records
var batchChanges = grid.getBatchChanges();
if (batchChanges.addedRecords.length > 0 || batchChanges.deletedRecords.length > 0 || batchChanges.changedRecords.length > 0) {
// execute the batchSave method if any changes applied in Grid
grid.editModule.batchSave()
}
}
</script>
|
Please get back to us if you need further assistance with this.
Regards,
Rajapandiyan S