SMART datagrid v.1 > Classes > TreeDataSet

[ grids ver.1.3.8]   Back  Forward

DataLudi.TreeDataSet.findRows  method

It searches fields which are transferred by parameter fields and values list and Data Rows corresponding to the value of each field and returns them as array. 

If does not exist, it will return null or an empty array. Each item of fields can be fieldName or index

function findRows (fields: [String|Integer], values: [*], strict: Boolean, maxCount: Integer): [TreeDataRow];
Returns
[TreeDataRow]
Parameters
fields - [String|Integer]. required.
values - [*]. required.
strict - Boolean. Defaults to false.
If it is true, it will compare with equalValues, and if it is false, it will compare with sameValues.
maxCount - Integer. Defaults to -1.
The maximum number of data rows of being returned. If do not specify or it is a value less than 0, it will return all found rows.
Code -1
    $('#searchRows').click(function () {
        var fields = ['customer_id', 'product_id'];
        var values = ['cust01', 'prod01'];
        
        var rows = ds.findRows(fields, values, false, -1);
        if (row) {
            var rows = tree.getRowsOfDataRows(rows);
            tree.checkAll(false);
            tree.checkRows(rows, true);
        }
    });
See Also
findRow
equalValues
sameValues
Tree Overview
Examples
Tree Data Set
Hello Grid