SMART datagrid v.1 > Classes > TreeDataSet

[ grids ver.1.3.7]   Back  Forward

DataLudi.TreeDataSet.findRow  method

It searches and returns fields which are transferred by parameter fields and values list and the first Data Row corresponding to the value of each field. 

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

If strict is true, it will compare with equalValues, and if it is false, it will compare with sameValues

function findRow (fields: [String|Integer], values: Array, strict: Boolean): TreeDataRow;
Returns
TreeDataRow
Parameters
fields - [String|Integer]. required.
values - Array. required.
strict - Boolean. Defaults to false.
Code -1
    $('#search').click(function () {
        var fields = ['customer_id', 'product_id'];
        var values = ['cust01', 'prod01'];
        
        var row = ds.findRow(fields, values, false);
        if (row) {
            row = tree.getRowOfDataRow(row);
            tree.setFocusedRow(row);
        }
    });
See Also
findRows
equalValues
sameValues
Tree Overview
Examples
Tree Data Set
Hello Grid