PDA

View Full Version : How to set combobox value after form loaded if i don't load the combo's store before?



safewolf
31 Dec 2010, 9:22 PM
hi, everyone

i have a formpanel now

in the form panel, i have a combobox like this:

{
store:someStrore,
displayField:'name',
valueField :'id'?
triggerAction : 'all',
mode : 'remote',
minChars : 1,
name : 'mycombo'
}


when i load the form, the data will be load liek{mycombo:1}


then, the problem comes

the combobox will display 1 rather than the related name in the box

and when i submit the form again ,the mycombo will be empty

how can i set the correct value 1 to the combo and display the related name in the box?

darthwes
31 Dec 2010, 10:37 PM
Hook setvalue and toss an event. See this thread (http://www.sencha.com/forum/showthread.php?118014-Chained-combo-onSetValue&p=548665#post548665).