SMART datagrid v.1 > Classes > GridDataSet

Back  Forward

DataLudi.GridDataSet.setRows  method

Delete all existing data of data set and fill with the rows within the range which is specified by start and count among the rows transferred by rows

If checkStates is true, it will initialize the state of data rows by rowState value. After appending rows, onRefresh, onRowCountChanged events will be fired in order. 

function setRows (rows: Array, start: Number, count: Number, rowState: DataRowState);
Returns
Void
Parameters
rows - Array. required.
start - Number. Defaults to 0.
count - Number. Defaults to -1.
If it is a value less than 0, it will fill until the last row.
rowState - DataRowState.
The state of rows of being created. If do not specify, it will be specified as NONE.
Code -1
    ds.setRows([
        ['val1', 'val2', 222, 333],
        {
            'field1': 'val22',
            'field2': 'val33',
            'field3': 555,
            'field4': 777
        },
        ...
    ]);
See Also
setRowCount
DataSet.onRefresh
DataSet.onRowCountChanged
Examples
SetRowCount