Tuesday, August 13, 2019

Dynamic set / update filter value in gridfilter extjs

Hello,

We have added the following functionality to the GridFilters
 
Each filter has SetActive and SetValue methods which can be used to set filter value during AjaxEvent
 
On client side you can use the following functions to set filter
 
grid.clearFilters();
grid.getFilter('dataindex').setValue("value"); //string filter
grid.getFilter('dataindex').setValue(true); //bool filter
grid.getFilter('dataindex').setValue({gt:2, lt:9, eq:5}); //numeric filter
grid.getFilter('dataindex').setValue({before: new Date(2008,0,1), after:..., on:...}); //date filter
grid.getFilter('dataindex').setValue(['item1', item2]); //list filter

grid.getFilter('dataindex').setActive(false); //turn off filter
Comments are always welcome :)