Hi Thomas,
Thanks for using Syncfusion Products.
The delete operation was performed by using the deleteSelected method and the selected record get by using getSelectedRecords method in Grid.
Please refer to the following Help document for getSelectedRecords,
http://helpjs.syncfusion.com/js/api/ejgrid#methods:getselectedrecords
In actionBegin event, we have deleted the selected record by passing the selected record values to the selectedItem.
Please refer to the sample and code example as below,
Sample: local-lightswitch
itemTemplate.ejGrid( { dataSource: contentItem.value.data, actionBegin: function (args) { if (args.requestType == "delete") { contentItem.value.selectedItem = this.getSelectedRecords()[0]; contentItem.value.deleteSelected(); //delete the records in grid myapp.applyChanges(); } }, . . .
}); |
To Display the confirm message box when deleting the records in Grid, we suggest you to enable the showDeleteConfirmDialog property. Please refer to below code example and Help document,
itemTemplate.ejGrid( { dataSource: contentItem.value.data, editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, showDeleteConfirmDialog: true }, },
. . .
});
<style> .e-grid .e-dialog .e-buttons{ float:none; } .e-grid .e-dialog .e-btn-mini{ width:100%; height:100%; } </style> |
Help Document http://helpjs.syncfusion.com/js/api/ejgrid#members:editsettings-showdeleteconfirmdialog
Regards,
Balaji Marimuthu
Hi Thomas,
We are happy that the provided suggestion helped you.
Please get back to us if you need any further assistance.
Regards,
Balaji Marimuthu