stever
10 Apr 2009, 12:56 PM
If you create a color menu like this:
new Ext.menu.ColorMenu({
listeners:{
select: ...
Your select handler will get called twice. The color palette will get it from the initial config and it will get relayed to the menu which will then also call it.
Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, {
...
initComponent: function(){
Ext.apply(this, {
plain: true,
showSeparator: false,
items: this.palette = new Ext.ColorPalette(this.initialConfig)
});
Ext.menu.ColorMenu.superclass.initComponent.call(this);
this.relayEvents(this.palette, ['select']);
},
new Ext.menu.ColorMenu({
listeners:{
select: ...
Your select handler will get called twice. The color palette will get it from the initial config and it will get relayed to the menu which will then also call it.
Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, {
...
initComponent: function(){
Ext.apply(this, {
plain: true,
showSeparator: false,
items: this.palette = new Ext.ColorPalette(this.initialConfig)
});
Ext.menu.ColorMenu.superclass.initComponent.call(this);
this.relayEvents(this.palette, ['select']);
},