3 Replies Latest reply on Aug 5, 2010 1:43 PM by ejstembler73

    Accessing ItemRenderer from Parent DataProvider?

    ejstembler73

      Is it possible to access the individual ItemRenderer based on a data item from the Parent control?

       

      For example, I'm using Alex Harui's CheckBoxList control which uses his CheckBoxRenderer.  I want to be able to toggle all of the checkboxes on or off.  I've added a new function toggleAll to CheckBoxList, which looks like this:

      
      public virtual function toggleAll(selected:Boolean):void
      {
           if (dataProvider == null)
                return;
           
           for each (var item:Object in dataProvider)
           {
                if (item == null)
                     continue;
               
                item.selected = selected;
           }
      
           invalidateProperties();
      }
      

       

      However, I think I really need to access the itemRenderer and set selected there instead.