SMART datagrid v.1 > Examples

[ grids ver.1.3.3]   Back  Forward

Tree Row Filtering  Example
no-lite

When configure the tree row models from DataSet, you can specify the row filter by Expression or callback function through rowFilter property, so that it can only get the data rows matching the criteria. For example, in the grid below, it specifies the filter which gets only "The first 10 rows (top n)" and "The last 10 rows (bottom n)" or display "Only the updated rows"

If specify OperateOptions.passiveFiltering as true, even if the top rows have been excluded from the filter, they will also be displayed if the included descendants are remained after the filtering. 

 

Tree - 1
rows

 

Code -1
    grdMain.setRowFilter({
    	callback: null,
    	expression: "row < 10"
    });

 

Code -2
    grdMain.setRowFilter({
    	callback: null,
    	expression: "row >= rowcount - 10"
    });

   

Code -3
    grdMain.setRowFilter({
        expression: "state == 'u'",
        callback: null
    });

 

Code -4
    grdMain.setRowFilter({
    	expression: null,
    	callback: null
    });

Actually, Row Filter is managed by RowFilter object from the row model. And, since the row filter is applied before the column filters in the row model level rather than the grid, it will be reflected in all grids when two or more grids share the row model. 

View Source JSP 

See Also
RowFilter
GridBase.rowFilter
OperateOptions.passiveFiltering
Tree Overview
Examples
Tree Filtering