Solution ( it worked for me )
Brother , i think this is the solution you've been looking for .
just add this listener to your combobox.
listener: {
afterrender:function(combo){
combo.setValue(id);//value of valueField of combo
combo.setRawValue(name);// value of DisplayField of combo
}
}
also be sure to have autoLoad: true on your store and queryMode: 'local' on your combo.
control characters can cause this
I know this is an old post, but I had a similar problem with a combo box that was configured correctly submitting the displayfield instead of the valuefield. It also returned the displayfield when directly calling "getValue" on the combo.
In my situation, I found that the original displayField data (text) sometimes contained newline characters ("\r\n"), which once removed, caused the combo to act as intended.
Since I didn't find any other posts referring to this odd behavior, I thought I would do my part and put it out there for others. I assume other control characters (e.g., "\t") might also cause the problem, though I did not delve into the Ext framework to find out the underlying cause.