SMART datagrid v.1 > Classes > GridDataSet
Delete the rows corresponding to data row index list which is transferred by rows. Actually, if delete one or more rows, the event will be fired according to rowEvents setting.
If rowEvents is true, onRowDeleted,onRowCountChanged events will be fired whenever deleting individual rows, and if do not specify or specify as false, onRowsDeleted and onRowCountChanged events will be fired in order after deleting all rows.
// Deleting event handler
ds.onRowsDeleted = function (ds, rows) {
console.log(rows.length + 'The rows have been deleted.';
}
ds.onRowCountChanged = function (ds) {
} $('#txtCount').val(ds.rowCount());
// Delete the checked data rows.
var rows = [];
for (var i = 0, cnt = grid.rowCount(); i < cnt; i++) {
var row = grid.getRow(i);
row.isChecked() && row.dataIndex() >= 0 && rows.push(row.dataIndex());
}
if (rows.length > 0) {
ds.deleteRows(rows, false);
}