PDA

View Full Version : [OPEN-501] Combobox filter



leandrorc
27 Jan 2010, 2:16 PM
Hi people,

I have a checkbox with a check listener, and when it's checked, a combobox is filtering, when it's unchecked, the filtering is cleared. The problem is that when i check the checkbox, the combobox is not filtered if it was not expanded before. Very strange! So, i have to click to expand the combobox, check the checkbox, then i can see the combobox filtered.

Ps: tested in Firefox 3.5 and IE 8, with ExtJs 3.1

Try it by yourself here:
http://www.startweb.com.br/test.php

Condor
27 Jan 2010, 11:56 PM
A mode:'local' combobox uses filtering internally, which will override your externally set filter.

You can skip the filtering by configuring the combobox with:

triggerAction: 'all',
lastQuery: ''

Condor
27 Jan 2010, 11:58 PM
This is a question that gets asked a lot.

Maybe we should change Ext.form.ComboBox.doQuery so it doesn't do a clearFilter() when it is configured with triggerAction:'all'.

Jamie Avins
28 Jan 2010, 6:50 AM
I was thinking the same thing.

leandrorc
28 Jan 2010, 3:42 PM
But it's a bug, guys! If something works, it just works, but in this case, filtering works only if i expand combobox once before check the checkbox, and the subsequent filtering works. A confused behavior, ain't?

evant
28 Jan 2010, 4:31 PM
The combo box filters values internally when the mode is set to local, this is the default behaviour.

What would you suggest is a "sane" behaviour in this case?

leandrorc
29 Jan 2010, 7:25 AM
I just want understand the following:

If i follow these steps:
1 - Page loads
2 - I check the checkbox
3 - combobox is filtered: food.getStore().filter('is_veg', 'y') is called
4 - I expand the combobox and i see the filter is NOT applyed


But if i follow these steps:
1 - Page loads
2 - I expand the combobox by clicking on the arrow
2 - I check the checkbox
3 - combobox is filtered: food.getStore().filter('is_veg', 'y') is called
4 - I expand the combobox and i see the filter is correctly applied

Jamie Avins
11 Feb 2010, 12:18 PM
The problem is that the same filters you are using, the combo itself uses. In order not to completely change current functionality, adding another flag which turns off all internal combo filtering should work for cases like this. Maybe a noLocalQuery flag which keeps lastQuery empty and never touches the store filter. Any thoughts?

mystix
12 Feb 2010, 1:59 AM
How about naming it disableLocalFilter instead?

Jamie Avins
12 Feb 2010, 9:14 AM
How about naming it disableLocalFilter instead?

That works for me. This would be a 3.2.x change.