PDA

View Full Version : Set background color of component and it's children



dijksvi
13 Sep 2010, 12:42 PM
Hi,

I'm trying to write a function that will dynamically change the background color of my Ext.Panel and all of it's children (items), plus their children etc. Somehow I believe this should be a recursive process. Unfortunately I'm quite a newbie in using java script, and don't really know how to do this. Any pointer or sample is highly welcomed.

Thanks,

Vincent :)

Animal
13 Sep 2010, 10:11 PM
This is what CSS is for!

dijksvi
13 Sep 2010, 11:55 PM
Thanks for the tip. I will look into this.

Vincent

dijksvi
14 Sep 2010, 11:13 PM
This solved my problem. I added the following in my CSS to change the background of my Eanels.

.editable-selected .x-panel-body {
background-color: lightblue;
}

and on the mouseover/ mouseout events of a button I used the "addClass("editable-selected") and removeClass("editable-selected")" functions.

Works as a charm.

Vincent