SMART datagrid v.1 > Classes > GridBase

[ grids ver.1.3.7]   Back  Forward

DataLudi.GridBase.revealRow  method

Expand all ancestor rows of Grid Row specified by parameter row object to show the row. 

And, if "focus" is true, it will select the specified row as focused row, and if display is true, it will scroll to show in grid screen. 

function revealRow (row: GridRow, focus: Boolean, display: Boolean);
Returns
Void
Parameters
row - GridRow. required.
focus - Boolean. Defaults to false.
If it is true, it will let the specified row be the current row.
display - Boolean. Defaults to false.
If it is true, it will scroll to display on grid screen which is displayed now.
Code -1
    $('#findRow').click(function () {
        var name = $('#name').val();
        var dept = $('#dept').val();
        var datarow = ds.findRow(['name', 'dept'], [name, dept]);
        if (datarow >= 0) {
            var row = grid.getRowOfDataIndex(datarow);
            grid.revealRow(row, true, true);
        }
    });
Code -2
    $('#findRow').click(function () {
        var name = $('#name').val();
        var dept = $('#dept').val();
        var datarow = ds.findRow(['name', 'dept'], [name, dept]);
        if (datarow) {
            var row = grid.getRowOfDataIndex(datarow.rowId());
            // or
            var row = grid.getRowOfDataRow(datarow);
            grid.revealRow(row, true, true);
        }
    });
See Also
GridRow
GridBase.getRowOfDataIndex
GridBase.focusedRow
GridDataSet.findRow
TreeView.getRowOfDataRow
TreeDataSet.findRow
Examples
Row Model
Tree Rows