SMART datagrid v.1 > Classes > GridDataSet
Return the expression specified in filter parameter or the index of data rows matching callback function as array.
If specify by callback, it will transfer the parameter as below, and if it is the row included in result, it should return true.
row is the number of data row which is under review now, and count is the number of rows which have been added up to now.
In the table below, it has listed the variable list which can be used in expression.
Variable | Explanation |
---|---|
'values | Get the value of each field to field name or index. |
'row' | The index of data row of being calculated. |
// The rows of which company name starts with 'a' and quantity is greater than 100.
var rows = ds.filterRows(function (ds, row, count) {
return ds.getValue(row, 'country').indexOf('a') == 0 && ds.getValue(row, 'qty') > 100;
});
rows = grid.getRowsOfDataIndices(rows);
grid.checkAll(false);
grid.checkRows(rows);
// Get the rows of which quantity is greater than 100 up to 10.
var rows = ds.filterRows("values['qty'] > 100", 10);
rows = grid.getRowsOfDataIndices(rows);
grid.checkAll(false);
grid.checkRows(rows);