PDA

View Full Version : Combobox in editor grid showing Id field



SAP
14 Oct 2010, 6:12 AM
Hi,

I have an editor grid with Combobox inside.

Combobox is showing Id field instaed of Display field.

How to show display field in Combobox in editor grid ?

I have attached code sample here.

Thanks in advance,

Anand

sideeque
14 Oct 2010, 8:10 AM
Add config displayField and assign the store element

var selectWeekStore = new Ext.data.SimpleStore({
fields: ['code', 'name'],
data: [['1','week1'],['2','week1'],['3','week1']]
});

var selectWeek = new Ext.form.ComboBox({
fieldLabel : 'Select a Week',
name: 'fldCalibUnitList',
store: selectWeekStore,
mode: 'local',
displayField: 'name',
valueField: 'code',
triggerAction: 'all',
selectOnFocus:true,
forceSelection:true,
editable: true,
resizable: true,
lazyRender:true,
width: 120,
emptyText:'Select One'
});

SAP
14 Oct 2010, 9:37 PM
Thanks a lot.