SMART datagrid v.1 > Classes > GridDataSet

Back  Forward

DataLudi.GridDataSet.getRows  method

It returns values of data rows which have been contained in the range specified by startRow and count as two dimensional array. 

If no corresponding row, it will return an empty array. In order to get the value of each row as JSON object, you can call getRowObjects

function getRows (startRow: Integer|[Integer], count: Integer): Array;
Returns
Array
Parameters
startRow - Integer|[Integer]. Defaults to 0.
The number of first row which will get values.
If do not specify, it will get from the first row.
And, if specify as an array of data row number, it will only get values of specified rows. v 1.3.8 In this case, count parameter will be ignored.
count - Integer.
The number of rows which will be imported. If do not specify, it will get until the last row.
Note
Code -1
    var rows = ds.getRows(0, 100);
    for (var i = 0; i < rows.length; i++) {
        var row = rows[i];
        for (var c = 0; c < row.lengt; c++) {
            console.log(row[c]);
        }
    }
Code -2
    // Get all rows.
    var rows = ds.getRows();
    console.log(rows);
Code -3
    // Get rows which have been specified as list.
    var rows = grid.checkedDataIndices();
    rows = ds.getRows([rows]);
    console.log(rows);
See Also
getValues
getRowObject
getRowObjects
getRowProps
getRowsProps
Examples
Grid Data Set Rows