PDA

View Full Version : Combo displayfield and tpl



SabaSarwat
26 Oct 2010, 2:17 AM
I have a problem in my combo, when i don't use a displayfield in combo tpl should be used in place of it but after using this approach when a user selects something from combo it remains empty and if i give displayfield, it only gives the 'type' of the store not the tpl. Code is given below. Kindly tell me where am i wrong?


myCombo = new Ext.form.ComboBox({
store: new Ext.data.ArrayStore({
fields: ['type', 'value'],
data : [
['New', 'All'],
['Old', 'P'],
['Latest', 'K']
],
displayField:'type',
valueField: 'value',
mode: 'local',
forceSelection: true,
triggerAction: 'all',
selectOnFocus:true,
emptyText:'Select...',
selectOnFocus:true,

tpl:'<tpl for="."><div class="x-combo-list-item">{type}, {value}</div></tpl>',

listeners:{....}

});