| DHTMLX Documentation

# Filtering Data in dhtmlxTreeGrid

While filtering in plain grid is pretty obvious and has not space for variations, filtering in TreeGrid can be applied in many different ways.

### Filtering by level

By default filtering in TreeGrid affects only last level of hierarchy (leaf items)
( the mode can be also enalbled by using grid.setFilrationLevel(-1) )
For example next dataset
Will be filtered as
the branches , there item not find, will be full hidden
values on not last levels ignored.
By using setFiltrationLevel method , it possible to change level of filtration

> grid.setFiltrationLevel(1); //upmost level has index 0

After such command filtering use data from different level of hierarchy and filtering will show next results
In second case you can see that items below find math preserved
It possible to force grid to filter data on all levels of hierarchy at the same time.

> grid.setFiltrationLevel(-2);

In such mode filtering show only items that math filtering criteria, lower level items not shown

### "Top level show" mode

Mode can be enabled by

> grid.enableFiltrationMode(-1,true)

In such mode, the upper level items, which has not childs matching for filtering criteria still shown, items from filtration level and below - are hidden.
( on second item , both Music and DVD not matched to filtering criteria, because filtering run only against last level items, but still shown )
© DHTMLX, 2008