PDA

View Full Version : Can't filter a local combobox.



cwolves
17 Jun 2007, 4:31 PM
Like the title says, it's impossible to filter a combobox with mode=='local' and triggerAction=='all'.


if(this.mode == 'local'){
this.selectedIndex = -1;
if(forceAll){
this.store.clearFilter();

Since there's no 'beforeclear' trigger, I had to delete clearFilter to get it to work:

this.columnStore.clearFilter = function(){};


Just saying that there should be a way to do this.

jack.slocum
18 Jun 2007, 3:22 AM
The combo uses filtering to work in local mode. This means you can't use your own filters on the store when in local mode as they will conflict. There's a thread in Premium Forums on how you could workaround this limitation.

cwolves
18 Jun 2007, 6:17 AM
From Ext.form.ComboBox.doQuery


if(forceAll){
if(this.triggerAction!='all')
this.store.clearFilter();
}else{
this.store.filter(this.displayField, q);
}

I just added "if(this.triggerAction!='all')". Should solve the issue. If the store is not touched by other code then it will always be empty, thus no need to ever clear it. If other code is modifying it then this allows other filters to work.