tags:

views:

489

answers:

3

I have a formPanel with two of the form items as comboboxes with their stores populated by the database. The value from comboBoxA needs to be used to get the value for comboBoxB however comboBoxA.getValue() (as well as getRawValue()) are returning undefined.

storeA.load();

var comboBoxA = Ext.getCmp(comboBoxAID);
storeB.baseParams.UserID = comboBoxA.getValue();
storeB.load();
+3  A: 

As noted in the docs, store loading is asynchronous, so you have to do your additional processing within the appropriate callback:

storeA.on('load', function(){
    var comboBoxA = Ext.getCmp(comboBoxAID);
    storeB.baseParams.UserID = comboBoxA.getValue();
    storeB.load();
});
storeA.load();
bmoeskau
A: 

Loading a ComboBoxes store does not actually select a value. Try making a selection first (or loading a record into the form, etc). It sounds like your trying to link the 2 combos. If thats the case, search around for a tutorial, there are few out there. This should get you started, Linked Combos.

Gerry
A: 

You might want to try this. It might be exactly what you are looking for. It also has a demo on the same page. The page is in german but the demo is predictable and the code is in english so test this.

Manny Calavera