SMART datagrid v.1 > Classes > GridDataSet

Back  Forward

DataLudi.GridDataSet.canInsertRow  method

如果可以在row位置添加新的数据行,就会返回true。 

function canInsertRow (row: Number): Boolean;
Returns
Boolean
Parameters
row - Number. required.
Note
当在网格视图开始用户插入时,将会首先检查从这个函数中所返回的值。
在GridDataSet类中,如果row是范围中的值,就会始终返回true
Code -1
    $('#insert').click(function () {
        // 在网格中,在当前的聚焦位置,插入新的行。
        var rowIndex = grid.focusedRow().dataIndex();
        if (dataset.canInsertRow(rowIndex)) {
            dataset.insertRow(rowIndex, ['value1', 'value2', 100, true]);
        }
    });
See Also
canUpdateRow
canAppendRow
canDeleteRow
canUpdateValue
Examples
网格数据组编辑
行插入