0 Replies Latest reply on Sep 15, 2010 6:22 PM by gl@hw

    How do I change the background color of a tree node?

    gl@hw

      I have the following ItemRenderer file:

       

      public class MenuItemRenderer extends TreeItemRenderer
           {
                     
                public function MenuItemRenderer()
                {
                     super ();
                }          
                
                override public function set data(value:Object):void {
                     
                     super.data = value;
                     
                     if (super.listData){                    
                          
                          var tld:TreeListData = TreeListData(super.listData);               
                          
                          if(tld.depth > 1){                         
                               this.setStyle("background-color","green");                              
                          }               
                     }
                }
                         
           }
      

       

      For all child nodes, I want the background to be a different color. I'm assuming that's the right CSS style. I've also tried other variations such as backgroundColor or bg-color.  Doesn't do anything, though.... what am I missing?

       

      Thanks.