6 Replies Latest reply on Jan 9, 2012 5:19 AM by jfb00

    Item Renderer in flex 4.5

    jfb00 Level 3

      Hi,

      I am building itemRenderer in sdk 4.5 now, i used to get listData in sdk 3.5 as

      String(listData["owner"]["dataProvider"].getItemIndex(data) + 1);

       

      Is not available anymore, how can I do that?

      My code so far:

       

      <?xml version="1.0" encoding="utf-8"?>

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

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

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

                      implements="mx.controls.listClasses.IListItemRenderer" >

          <fx:Script>

              <![CDATA[

                  import mx.controls.listClasses.IListItemRenderer;

                 

                  override public function set data(value:Object):void

                  {

                      super.data = value;

                      if(value != null){

                          myLabel.text = ""; //String(listData["owner"]["dataProvider"].getItemIndex(data) + 1);

                      }else

                          myLabel.text = "";

                  }

              ]]>

          </fx:Script>

          <s:Label id="myLabel" />

       

      </s:ItemRenderer>

       

      Thanks