PDA

View Full Version : custom color palette with default color picked?



kirillica
28 Nov 2010, 6:10 AM
I was searching through API and haven't found is it possible to set default value for a color menu?

Condor
28 Nov 2010, 11:49 PM
A ColorMenu uses it's own config to create a ColorPalette, which has a 'value' config option.

kirillica
29 Nov 2010, 1:24 PM
A ColorMenu uses it's own config to create a ColorPalette, which has a 'value' config option.

Then please tell me, what is wrong with this code:


var colorPalette = new Ext.ColorPalette({
value: "000000"

});

var colorMenu = new Ext.menu.ColorMenu({
handler: function(cm, color){
...
},
palette: colorPalette
});

It's not showing black to be selected by default...

Condor
29 Nov 2010, 11:25 PM
ColorMenu doesn't have a 'palette' config option. It does however have a 'value' config option.