PDA

View Full Version : [OPEN] [CLOSED][3.??] colorpalette.select() bug



jurban
15 Sep 2009, 1:09 PM
I can not get colorpalette.select(anewcolor) to work. I get the error

Line: 7
Error: 'child(...)' is null or not an objectHere is an example I created buy cutting code from our application. Clicking on the "Change Color" button should select the white color.



Ext.onReady(function(){

fTagPanel = new Ext.Panel({
labelWidth: 125,
id: 'tagpanel_14',
bodyStyle: 'padding:3px 3px 0',
items: [{
layout:'column',
items:[
{layout:'form',columnWidth:1,items:
[
{xtype:'colorpalette', fieldLabel: 'Font Color', id: 'element_14', value:'000000'}
]}
]
}],
layoutConfig:{
animate:true
},
border:false
});

var XMLEditForm = new Ext.form.FormPanel({
labelWidth :125,
border :false,
frame :true,
bodyStyle :'padding:5px 5px 0',
autoDestroy :false,
onFailure : function(form, action) {
alert(action.result.error || action.response.responseText);
},
items :[{
layout:'column',
items:[
{layout:'form',columnWidth:1,items:
[
fTagPanel
]
}
]}
]});

var XMLlEditWindow = new Ext.Window({
closeAction :'hide',
title : 'Test',
width :850,
height :500,
layout :'fit',
plain :true,
modal :true,
items :[XMLEditForm]
});

XMLlEditWindow.addButton({text :'Change Color', disabled :false, handler : function() {
Ext.getCmp('element_14').select('FF,FF,FF');
}});

XMLlEditWindow.show();

});

evant
15 Sep 2009, 5:44 PM
You're not passing the correct value, it's expecting 'FFFFFF', not 'FF,FF,FF'.

Marking as closed.