tobiu
21 Jul 2010, 2:34 AM
hi team,
i found a code snippet in our app, where a menu-item looked like it had 2 icons at once, flying above each other.
so, i build a small testcase to isolate the issue:
just drop it into menu.js in the examples folder -> menu
Ext.onReady(function(){
var tb = new Ext.Toolbar();
tb.add({
text:'Button w/ Menu',
menu: {
defaults: {
icon: 'menu-show.gif'
},
items: [{
text: 'Aero Glass',
icon: 'list-items.gif'
},
'-',
{
text: 'Vista Black',
icon: 'list-items.gif'
}, {
text: 'Gray Theme'
}, {
text: 'Default Theme'
}]
}
});
tb.render('toolbar');
});
and take a close look at the aero-glass icon -> firebug.
the funny thing is, that with the default-config of icon, the Ext.menu.Separator also gets that config. Although it is not listed in the API, it is there since Ext.menu.Separator is an extension of Ext.menu.BaseItem.
so, i suggest that icon (and iconCls?) should be checked in the initComponent and be resetted if needed. if there are no plans to display them properly at least :)
kind regards
tobiu
edit: replaced toolbar with menu =) hope it got clear anyway.
i found a code snippet in our app, where a menu-item looked like it had 2 icons at once, flying above each other.
so, i build a small testcase to isolate the issue:
just drop it into menu.js in the examples folder -> menu
Ext.onReady(function(){
var tb = new Ext.Toolbar();
tb.add({
text:'Button w/ Menu',
menu: {
defaults: {
icon: 'menu-show.gif'
},
items: [{
text: 'Aero Glass',
icon: 'list-items.gif'
},
'-',
{
text: 'Vista Black',
icon: 'list-items.gif'
}, {
text: 'Gray Theme'
}, {
text: 'Default Theme'
}]
}
});
tb.render('toolbar');
});
and take a close look at the aero-glass icon -> firebug.
the funny thing is, that with the default-config of icon, the Ext.menu.Separator also gets that config. Although it is not listed in the API, it is there since Ext.menu.Separator is an extension of Ext.menu.BaseItem.
so, i suggest that icon (and iconCls?) should be checked in the initComponent and be resetted if needed. if there are no plans to display them properly at least :)
kind regards
tobiu
edit: replaced toolbar with menu =) hope it got clear anyway.