3 Replies Latest reply on Jul 5, 2009 7:04 AM by Benoitcn

    How to iterate items in repeater?

    Benoitcn Level 1
      I wanna change some specific item's style which inside the repeater component.
      How can I iterate the items in the repeater and filtrate them ?
        • 1. Re: How to iterate items in repeater?
          _Natasha_ Level 4


          there are two variants for it.

          The first is to bind this style to Repeater's dataProvider and change this style in dataProvider so it's automaticaly change the style.

          The second variant is to get childDescriptors from Repeater and change style for all items.

          1 person found this helpful
          • 2. Re: How to iterate items in repeater?
            Muzak Level 3

            Tried the docs?



            About halfway down the page: Referencing repeated components

            1 person found this helpful
            • 3. Re: How to iterate items in repeater?
              Benoitcn Level 1

                I can't change the repeater component's style. why ~~


              private function clickHandler(event:MouseEvent = null):void
                  /* testing codes */
                  var ar:Array = [7, 4, 5, 9];
                  for (var i:int = 0; i < ar.length; i++)
                  stairContainer[ar[i]].setStyle("background-color", "#ffffff");


                  // this works

                  //stairID[ar[i]].text = ar[i];


              <mx:Tile id="stairDetailList" width="67%" top="0" paddingLeft="5" paddingRight="5"
                  horizontalGap="3" verticalGap="3" paddingTop="4" paddingBottom="4"
                  shadowDirection="center" shadowDistance="7" kerning="true" height="100%">
                <mx:Repeater id="stairDetailListRepeater" count="72" recycleChildren="true" startingIndex="1" dataProvider="{dataSource}">
                  <mx:Canvas id="stairContainer" styleName="HouseButtonSkin" width="85" height="65">
                  <mx:Label id="stairID" text="911" condenseWhite="true" horizontalCenter="0" verticalCenter="0" click="clickHandler(event)"/>