PDA

View Full Version : Store filtering for combobox and bindStore.



agony
5 Jan 2015, 7:12 AM
The store is bonded to the combobox with bindStore in a separate function.


It all works fine - except that i need to filter the data in that function based of the given parameters.



loadMarkers: function(store, value){

store.filter('resellerid',17);

this.fields.marker.bindStore(store);
this.fields.marker.getStore().filter('id',17);
this.fields.marker.setValue(value);
}
This specific example has two diff ways iv tried it - before binding and after. Console.log at the end shows filtered store for both 'store' and even the combobox. But the combobox itself still shows everything.


I even set the (on combobox config)



lastQuery: ''
And it had no effect.

lumberjack
13 Jan 2015, 8:02 AM
It does not seem to play nicely when using the bindStore method. Can you adjust your logic so that the store is provided to the combo when the combo is created? The filtering (post load of the store) is working correctly with that approach.

Regards,
Brian

gbf

agony
13 Jan 2015, 10:42 PM
I end up cloning the filtered store and then binding it.I couldn't use listener - the store had to be loaded once with main grid load. And then the combobox populated based of the parameters from rowselect - without having to re-request the store over ajax each time. The id parameter (17) would have been a variable in real situation.