PDA

View Full Version : After clearing filter(s) of store, type query does not work



talha06
4 Sep 2015, 3:15 PM
I'm using instances of a combobox for multiple user interfaces. So I need to reset combobox stores when user focuses on it. Combo's store is locally sorted; so I execute clearFilter() function of Ext.data.Store class - it works as it is expected except that typing query does not work anymore.


Here is my combobox configuration:


forceSelection: true,
autoSelect: false,
typeAhead: false,
triggerAction: 'all'


Store configuration:


autoLoad: false,
autoSync: false,
remoteSort: false,
proxy: {
type: 'ajax'
// other configs
}

tristan.lee
8 Sep 2015, 11:11 AM
Can you provide a fiddle (https://fiddle.sencha.com) demonstrating the issue so I can work with you on resolving this?

f.baron
11 Sep 2015, 2:18 AM
Not sure about this solution, I think the combo should maintain the query value in "lastQuery" field. Try to append a listener (only to remote-editable combos) like this:


beforequery: function(qe) {
if (!qe.query && qe.combo.lastQuery) {
qe.query = qe.combo.lastQuery;
}
}



I had the same need on local sotres and anymatch filter, my solution for that is



Ext.define('Ext.data.StoreOverrideForAnyMacth', {
override: 'Ext.data.Store',
clearFilter: function(suppressEvent) {
var anyMatchFilters = this.filters.filter('anyMatch', true);
this.callParent(arguments);
this.filters = anyMatchFilters;
}
});