DHTMLX Docs & Samples Explorer

filterBy(column, value, preserve)

Required library edition: This method requires Professional Edition of the DHTMLX library
Required library file: dhtmlxgrid_filter.js

filter grid by mask

  • column - {number} zero based index of column.
  • value - {string} value by which the column will be filtered.
  • preserve - {true|false} filter current or initial state (false by default)
   //filter grid by 2nd column by value "alf"
   mygrid.filterBy(1,"alf");
   //filter grid by 2nd column with more comlex rule
   mygrid.filterBy(1,function(data){
            return   data.toString().indexOf("alf")!=-1;  // true - show the related row , false - hide the related row
   });
   //filter current grid state by 3rd column by value "Omega" 
   mygrid.filterBy(2,"Omega",true);

See also: filterByAll, findCell, makeFilter, getFilterElement