Icon In ExtJs Combo

How to display the icon along with the display field in ExtJs Combo.Is There is an extension for extjs combo. Please provide some examples.

+7
source share
3 answers

For ExtJS4, add listConfig with the getInnerTpl method to the combo box:

xtype: 'combobox', anchor: '100%', listConfig: { getInnerTpl: function(displayField) { return '<img src="/images/icons/{id}.png" class="icon"/> {' + displayField + '}'; } }, name: 'type', fieldLabel: 'Group Type', displayField: 'label', hiddenName: 'type', queryMode: 'local', store: 'group.Types', valueField: 'id' 
+5
source

In another way, I think you can improve it, but it works fine for me:

  ,store: new Ext.data.ArrayStore({ id: 0, fields: [ 'lang', 'desc','url' ], data: [['CA','Spanish','es.gif'],['VA','Valencian','va.gif']] }) ,tpl : '<tpl for=".">'+ '<tpl if="0==0"><div class="x-combo-list-item" ><img src="../img/{url}"> {desc}</div></tpl>'+ '</tpl>' 
0
source

All Articles