PDA

View Full Version : Custom Colors with Colormenu! It should but it doesn't!



overnoise
20 Feb 2008, 4:57 PM
I'm using ExtJs 2.0

The problem is in :
cp.colors = ["000000", "993300", "333300"];
this code should work, it basically the same code in the documentation but it doesn't! It doesn't output my array of colors!

This works instead:
cp.colors[0] = "FF0000";








// private
// Implements the default empty TriggerField.onTriggerClick function to display the ColorPalette
onTriggerClick : function(){
if(this.disabled){
return;
}
if(this.menu == null){

var cp = new Ext.ColorPalette();
cp.colors = ["000000", "993300", "333300"];
this.menu = new Ext.menu.ColorMenu();
this.menu.palette = cp;
}

this.menu.on(Ext.apply({}, this.menuListeners, {
scope:this
}));

this.menu.show(this.el, "tl-bl?");
}