PDA

View Full Version : IconCombo



edspace
28 Sep 2011, 3:40 AM
Hello,

I have downloaded extension Ext.ux.IconCombo.js to show icons in combobox! It works perfect, but in listener 'render' I have a litle problem..it says that "this.flag is undefined" Any idea?


new Ext.ux.IconCombo({
fieldLabel: lang.languageText,
triggerAction: 'all',
store: new Ext.data.SimpleStore({
fields: ['countryCode', 'countryLanguage', 'countryFlag'],
data: [
['en-US', 'English', 'x-flag-gb'],
['hr-HR', 'Hrvatski', 'x-flag-hr']
]
}),
mode: 'local',
valueField: 'countryCode',
displayField: 'countryLanguage',
iconClsField: 'countryFlag',
listeners: {
select: function (value, record, index) {
fSetCookie("slang", record.data.countryCode);
window.location.reload();
},
render: function (IconCombo, rec, index) {
if (fGetCookie('slang') == 'en-US') {
IconCombo.setValue(IconCombo.store.getAt(0).data.countryCode);
IconCombo.setRawValue(IconCombo.store.getAt(0).data.countryLanguage);
IconCombo.setIconCls(IconCombo.store.getAt(0).data.countryFlag);
}
else if (fGetCookie('slang') == 'hr-HR') {
IconCombo.setValue(IconCombo.store.getAt(1).data.countryCode); e IconCombo.setRawValue(IconCombo.store.getAt(1).data.countryLanguage);
IconCombo.setIconCls(IconCombo.store.getAt(1).data.countryFlag);
}
}
}
})