Results 1 to 4 of 4

Thread: Set background color of component and it's children

  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    50

    Default Set background color of component and it's children

    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

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    This is what CSS is for!

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    50

    Default

    Thanks for the tip. I will look into this.

    Vincent

  4. #4
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    50

    Default

    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

Similar Threads

  1. Cannot set textfield background color?
    By IvanJ in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 11 Nov 2009, 2:55 PM
  2. set background-color to a row of a grid
    By bhanu prakash dasari in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 30 Mar 2009, 11:34 PM
  3. set div background-color in IE6
    By geoffrey.mcgill in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 15 Jun 2008, 3:28 AM
  4. set background color for panel
    By mxu in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 22 Nov 2007, 8:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •