PDA

View Full Version : ExtJS 4.0.7 Dependent Combo Box Not Dropping Down (But Loading)



rkanemeier
6 Jun 2013, 3:47 PM
I have a series of combo boxes that are used as filters for a grid. The combo boxes should always display selections that match the currently selected criteria. For example, Austin is a city in Texas, but also in Arkansas, Colorado, Illinois, Indiana, Minnestora, Nevada, and Orgeon. So if I had a state combo and a city combo, and I selected state TX, then went to the city combo and selected Austin, when I go back to select the state combo again, I want it to reload the combo box with states that contain the name Austin.

I got the stores to load correctly, and after using chrome developer tools, I can see in the network tab that I am getting a good ajax request and response for the dependent combo box. The combo box's store has loaded, but the box never actually "expanded". I have to hit the little down arrow a second time to "expand" the box. Another side note, the 2nd time I hit the combo box, and the combo box doesn't expand, it still fires the "expand" listener.

Combo 1



xtype: 'combo',
itemId: 'filterField1',
name: 'filterField1',
store: field1store,
displayField: 'FIELDTEXT',
valueField: 'FIELDVALUE',
emptyText: 'ALL',
queryMode: 'local',
triggerAction: 'all',
selectOnFocus: true,
editable: false,
width: 75,
labelStyle: 'font-size: 10px;',
labelSeparator: ' ',
updateBeforeOpen: true, // control reloading store
listeners: {
expand : function(field, eOpts) {
if ( this.updateBeforeOpen ) {
this.updateBeforeOpen = false;
this.store.load();
}
},
select: function() {
myGrid.down('#filterField2').updateBeforeOpen = true;
myGridDataStore.loadPage(1);
}
}


Combo 2



xtype: 'combo',
itemId: 'filterField2',
name: 'filterField2',
store: field2store,
displayField: 'FIELDTEXT',
valueField: 'FIELDVALUE',
emptyText: 'ALL',
queryMode: 'local',
triggerAction: 'all',
selectOnFocus: true,
editable: false,
width: 125,
labelStyle: 'font-size: 10px;',
labelSeparator: ' ',
updateBeforeOpen: true,
listeners: {
expand : function(field, eOpts) {
if ( this.updateBeforeOpen ) {
this.updateBeforeOpen = false;
this.store.load();
}
},
select: function() {
myGrid.down('#filterPool').updateBeforeOpen = true;
myGridDataStore.loadPage(1);
}
}

friend
7 Jun 2013, 5:38 AM
If I remember correctly, there was a bug in ExstJs 4.0.7 which would cause this issue. Can you try a new release and see if that helps?

rkanemeier
11 Jun 2013, 4:05 PM
Is there a way I can find out what Sencha did to correct the issue and maybe hotfix that into my code?

rkanemeier
12 Jun 2013, 12:23 PM
Found it:

http://www.sencha.com/forum/showthread.php?181002-ExtJs-4-and-Linked-Chained-Cascading-Combobox-(remote)&p=734888&viewfull=1#post734888


(http://www.sencha.com/forum/showthread.php?181002-ExtJs-4-and-Linked-Chained-Cascading-Combobox-(remote)&p=734888&viewfull=1#post734888)