SMART datagrid v.1 > Classes > GridDataSet

Back  Forward

DataLudi.GridDataSet.canInsertRow  method

Return true if can insert new data row in row location. 

function canInsertRow (row: Number): Boolean;
Returns
Boolean
Parameters
row - Number. required.
Note
When start user inserting in grid view, it will check the value returned from this function first.
In GridDataSet class, it always returns true if row is within the range.
Code -1
    $('#insert').click(function () {
        // In grid, it inserts new row in the focused location.
        var rowIndex = grid.focusedRow().dataIndex();
        if (dataset.canInsertRow(rowIndex)) {
            dataset.insertRow(rowIndex, ['value1', 'value2', 100, true]);
        }
    });
See Also
canUpdateRow
canAppendRow
canDeleteRow
canUpdateValue
Examples
Grid Data Set Edit
Row Inserting