SMART datagrid v.1 > Classes > TreeDataSet

Back  Forward

DataLudi.TreeDataSet.deleteRows  method

It deletes one or more Data Rows which have been specified by parameter rows

Each item of rows can specify TreeDataRow object or rowId. If softDelete and checkStates are both true, it will be deleted only when the row state is CREATED and deleteCreated is true, else will not be deleted actually and will only change the state as DELETED. If the state of rows has already been DELETED or CREATE_AND_DELETED, it will not be changed either. 

Just before deleting, onRowsDeleting event will be fired, and after deleting, onRowsDeleted, onRowCountChanged events will be fired in order. 

If no row will be deleted actually in rows, it will do nothing. 

function deleteRows (rows: [TreeDataRow|Integer]);
Returns
Void
Parameters
rows - [TreeDataRow|Integer]. required.
Code -1
    $('#remove').click(function ()) {
        var rows = grid.getSelectedRows();
        if (rows && rows.length > 0) {
            var list = [];
            for (var i = 0; i < rows.length; i++) {
                list.push(rows[i].dataRow());
            }
            dataset.deleteRows(list);
        }
    }
See Also
DataSet.softDelete
DataSet.checkStates
onRowsDeleting
onRowsDeleted
DataSet.onRowCountChanged
DataSet.rowCount
TreeDataRow
Tree Overview
Examples
Tree Data Set
Hello Tree