2 Replies Latest reply on Jun 18, 2010 8:52 AM by EvolvedDSM

    itemRenderer doesn't show color bg.  [see code]

    EvolvedDSM Level 2

      Hello,

      I've been trying to get an itemRenderer within a <skinnableDataContainer> to have color in it's background.  The itemRenderer is a pair of labels that repeats over a set of records (retreived remotely) in the dataContainer.  I'm using a tileLayout with 7 columns so all the data (each itemRenderer) appears tiled.  Everything works fine except the itemRenderer will not show background colors for the normal and hovered states (it defaults to white).  Basically I want each repeating itemRenderer object within the container to have a background color.

       

      Application:

       

       

      <s:SkinnableDataContainer itemRenderer="components.tagoutInfo"

           creationComplete="list_creationCompleteHandler(event)"

           id="skinnableDataContainer"

           dataProvider="{getAlluserTableResult.lastResult}">

           <s:layout>

                <s:TileLayout requestedColumnCount="7"

                     orientation="rows"

                     horizontalGap="1"/>

           </s:layout>

      </s:SkinnableDataContainer>

       

      itemRenderer:

       

      <s:ItemRenderer name="tagoutInfo"

           xmlns:fx="http://ns.adobe.com/mxml/2009"

           xmlns:s="library://ns.adobe.com/flex/spark"

           xmlns:mx="library://ns.adobe.com/flex/mx"

           autoDrawBackground="false" fontSize="10">

           <s:layout>

                <s:VerticalLayout horizontalAlign="center" paddingBottom="4"/>

           </s:layout>

       

       

           <s:states>

                <s:State name="normal"/>

                <s:State name="hovered"/>

           </s:states>

       

       

           <s:Rect id="myRect"

                left="0" right="0" top="0" bottom="0"

                alpha="1.0">

                <s:stroke>

                     <s:SolidColorStroke color="black"

                          weight="1"/>

                </s:stroke>

                <s:fill>

                     <s:SolidColor color.normal="red" color.hovered="green"/>

                </s:fill>

           </s:Rect>

       

       

           <s:Label text="{data.firstName + ' ' + data.lastName}"/>

           <s:Label text="{data.reasonOut + ' ' + data.timeBack}"/>

       

      </s:ItemRenderer>