5 Replies Latest reply on Jun 25, 2010 7:33 AM by Francisc

    Flex4 - how to setStyle to itemRenderer of a DropDown?

    subverdotcom

      Hello,

      I have a function which uses setStyle to my components to change the color. I'm trying to target the itemRenderer of a DropDown from the main Application, but can't seem to do it. How can I make the itemRenderer inherit the custom styles passed to the DropDown?

       

      Typically I would, for instance, target a slider track button by using slider.thumb.setStyle("primaryColor", colorVar); - but it'd be nice if I could just use slider.setStyle() (instead of targeting the thumb). I believe I would have to use inherited styles, but I'm not sure how to go about it.

       

      Basically, how can I target the itemRenderer in a dropDown so I can change the color values of the highlighted/selected boxes?

      It'd also be nice if I could get a simple explanation for having all sub-components inherit the main parent components custom properties (in my case: "primaryColor")

       

      Hope this makes sense!

      Thanks