2 Replies Latest reply: Sep 6, 2013 9:03 AM by Flex harUI RSS

    How to syncronize between Itemrenderer and component

    pumpactionshotgun1

      I have a List component using Checkbox as ItemRenderer. Now the problem is there is no synch between checkbox and List selection.

      When the checkbox is selected/desected, I want to update selectedIndices property of the List and vice versa. The list is allowing multiple selection.

      Any sample code for this ?

       

      My code is as below:

       

      Assign Itemrenderer in List component:

      _list.itemRenderer=new ClassFactory(CheckBoxRenderer);

       

      CheckBoxRenderer.mxml

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

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

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

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

                  label="{data.name}"

                  selected="{data.isSelected}">

      </mx:CheckBox>