Check documentation for the latest version of dhtmlxSuite filterBy DHTMLX Docs

filterBy

filters TreeGrid by mask

void filterBy(number column,string value,boolean preserve);
columnnumbera zero-based index of column
valuestringa value by which the column will be filtered
preservebooleanfilter current or initial state (false by default)

Available only in PRO Edition

Example

//filter treegrid by 2nd column by value "alf"
myTreeGrid.filterBy(1,"alf");
//filter treegrid by 2nd column with a more complex rule
myTreeGrid.filterBy(1,function(data){
// true - show the related row, false - hide the related row
    return  data.toString().indexOf("alf")!=-1; 
});
//filter current treegrid state by 3rd column by value "Omega" 
myTreeGrid.filterBy(2,"Omega",true);

Back to top