PDA

View Full Version : Filter local store before its combobox is triggered



janhov
7 Sep 2011, 4:11 AM
Hi, I have two comboboxes configured with stores (data and queryMode local). A select listener on the first box is set to filter the second store.

What happens: The second store is not filtered unless I click the dropdown trigger on the second box first. I don't have to select anything in the second box, just expand the dropdownlist, and then select something in the first box to make it work.

I want to filter the second store without the need to click the second box trigger first. The store-is-not-loaded-yet problem is not present as this is a local store.

Thoughts?

skirtle
8 Sep 2011, 2:18 AM
This is a pretty common problem. Unless you know where to look it's not easy to find the solution either:

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.field.ComboBox-property-lastQuery

janhov
8 Sep 2011, 6:01 AM
Works. Thanks a lot.

mono blaine
27 Sep 2011, 1:51 PM
This is a pretty common problem. Unless you know where to look it's not easy to find the solution either:

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.field.ComboBox-property-lastQuery

This is like kicking a vending machine to grab something, and hysterically repeating to yourself the phrase "this is not a bug this is a feature".

Anyway, no words can express what I feel right now. this piece of sh*t cost me my whole day.

strickjb
15 Dec 2011, 11:15 AM
Thank you skirtle for the solution. This helped me achieve not hitting the server repeatedly...