Hello,
In essence, the slave collection is filtered according to the binding rule. So, when it is filtered by header filters, the binding filter is ignored.
You can change the .filterByAll()
method of the slave Datatable to preserve your binding rule.
The filterByAll()
method is called automatically, when the Datatable filters itself according to header filters. So, you need to apply the basic logic in it and filter the data again according to the binding rule: this.filter(rule, text, preserve).
var baseFilter = gridb.filterByAll;
gridb.filterByAll=function(){
baseFilter.call(this);
//repeat your binding rule
this.filter(function(obj){
//getCursor returns id of selected record in master
return obj.index == grida.getCursor();
}, null, true); //here the 3rd parameter preserves the existing filtering
};
gridb.bind(grida, function(slave, master){
return master.id == slave.index;
});
Check the following snippet, please: http://webix.com/snippet/fe13d3f4