Skip navigation
pumpactionshotgun1
Currently Being Moderated

How to syncronize between Itemrenderer and component

Sep 5, 2013 4:04 AM

Tags: #list #itemrenderer #synch #checkbox

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>

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points