SMART datagrid v.1 > Classes > TreeDataRow

Back  Forward

DataLudi.TreeDataRow.findChild  method

It returns the child row of which value of fields specified by parameter fields is the same as the one specified in values

If not found, it will return null. Each field of fields can be specified by string or Integer. The field which does not exist or is beyond the range will be excluded from search condition. It will search from child rows just below first, and if none and recursive parameter is true, it will continually search the level below. 

If strict is true, it will compare with DataField.equalValues, else will compare with sameValues

function findChild (fields: [String|Integer], values: Array, recursive: Boolean, strict: Boolean): TreeDataRow;
Returns
TreeDataRow
Parameters
fields - [String|Integer]. required.
values - Array. required.
recursive - Boolean. Defaults to false.
strict - Boolean. Defaults to false.
Code -1
    $('#find').click(function () {
        var row = tree.focusedRow();
        if (row) {
            var r = ds.findRow(['name'], [name]);
            if (r) {
                row = tree.getRowOfDataRow(r.index());
                row && grid.setFocusedRow(row);
            }
        }            
    });
See Also
TreeDataSet.findRow
TreeDataSet
Tree Overview
Examples
Hello Tree