Hi there,
I'm trying to dynamically add filters to a store for Ext.chart.Chart. My problem is that it doesn't allow multi-filtering.
Code:
doFiltering: function(view,node,group) {
var me = this,
store = view.up('window').down('chart').store,
filterList = [],
found = false;
store.filters.each(function(f) {
if (f.value === group) {
found = true;
} else {
filterList.push( Ext.create('Ext.util.Filter', {property: 'FuelStationName', value: f.value, root: 'data'}));
}
});
if(!found) {
filterList.push( Ext.create('Ext.util.Filter', {property: 'FuelStationName', value: group, root: 'data'}));
}
store.clearFilter(true);
store.filter(filterList);
console.log(filterList);
view.up('window').down('chart').redraw();
}
So far, it only filters for 1 item (the first item as far as i know) in the filterList array.
Any ideas?