If your filter logic is built on the base of the filterBy() method, you may pay attention at the third attribute of the method, which preserves the previous filters: docs.dhtmlx.com/api__dhtmlxgrid_filterby.html
I’ve 5 header filters, all defined with the grid.attachHeader() method: the first four using the default #text_filter or#select_filter, the last one using html.
The logic of the first four filters is the default, I haven’t overwritten it.
The logic of the last filter is defined by the custom grid_filtra_borsa() method, using filterBy and preserving the other filter.
function grid_filtra_borsa(value) {
grid_professionals_tots.filterBy(4,function(data){
// var esNumero = !isNaN(data.toString());
var esNumero = !(data.toString() == "-");
if (value == "1") { return esNumero; }
else if (value == "2") return !esNumero;
else return true;
}, false);
grid_professionals_tots.filterBy(0, grid_professionals_tots.getFilterElement(0).value, true);
grid_professionals_tots.filterBy(1, grid_professionals_tots.getFilterElement(1).value, true);
grid_professionals_tots.filterBy(2, grid_professionals_tots.getFilterElement(2).value, true);
grid_professionals_tots.filterBy(3, grid_professionals_tots.getFilterElement(3).value, true);
}
With this implementation I’ve this result:
The custom filter (the last one) is working ok, since when I select an option it filters and preserve the other filters
The problem is that when I use the other filters (default filters) it preserve the other default filters but it doesn’t preserve the custom filter (see previous video: dl.dropboxusercontent.com/u/171 … eserve.mp4).
It is like the default filters don’t know about the existence of the custom filter. I tried to use the ‘onCollectValues’ event and it doesn’t detect the custom filter (it only detects 3 select filters).