working code segment:
enter code here {xtype: 'fieldset', items: [{xtype: 'combo', hiddenName: 'category[line]', fieldLabel: 'Category', store: categories, emptyText: 'Select', triggerAction: 'all', mode: 'local', displayField: 'category_name', valueField: 'id', anchor: '50%', listeners:{ select:{fn:function(thisCombo, value) { var combo = Ext.getCmp('combo-subcats'); combo.enable(); //combo.clearValue(); /* category is part of the json data inside the subcat. So the first select choose the category - then filter out only that bit and populate the subcat combo. Make sense? */ combo.store.filter('category', values.data['category']); }} } }, {xtype: 'combo', hiddenName: 'subcats[line]', disabled: true, id: 'combo-subcats', fieldLabel: 'Sub Cat', store: getSubcatsStore(), emptyText: 'Select', triggerAction: 'all', mode: 'local', displayField: 'name', valueField: 'id', anchor: '50%', lastQuery: '' //<-- this is what makes it work. },
source share