PDA

View Full Version : extjs combo box selection using guid id



Anthony.Hall
26 Feb 2012, 12:28 PM
I am using the following to select an item in combo box.


var SupplierCombo = Ext.getCmp('SupplierCombo');
SupplierCombo.setValue(selection[0].data.SupplierId);
this is selecting the correct item in the combo however it is placing the id on the combobox as opposed to the supplier name, See screen shot. I my id field is a guid that is in string format. I wonder if this is related to my issue.


32152

skirtle
26 Feb 2012, 4:06 PM
What are your valueField and displayField set to? Could you post your combobox config? Please use [CODE] tags when posting code.

I would advise against using the data property where possible. Use the get method instead. I would also avoid using Ext.getCmp with a static id, that'll get you into all sorts of trouble.