Treegrid Row Filter

When we apply filters in treegrid, Row property is set to true. Let’s say we have 100 records of VA and DC equally distributed 50/50. If we don’t apply any filter then Row Visible property of all records is true.

If we apply VA filter then 50 records visible property will be true and remining 50 will be false.

The twist is hidden rows. Let’s say we have 2 DC records selected. We apply VA filter then row visible property of 52 records will be selected. To get a clean picture we need to reset DC hidden rows.

For custom implementation OnAfterValueChanged Event. This is a generic event and can be used for anything (cells, rows etc).

Here is a sample code snippt;

$.each(grd.Rows, function (index, row) {
   if (row.Visible == true) {
     grd.SetValue(rw, 'Select', val, true);
   }
}

Reference

https://www.treegrid.com/Doc/RowAPI.htm

FavoriteLoadingAdd to favorites
Spread the love

Author: Shahzad Khan

Software developer / Architect