flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark goldin <markzolo...@gmail.com>
Subject Chain of events when checkbox is in List
Date Fri, 22 Apr 2016 17:29:14 GMT
I have a checkbox renderer in my List.
Here is some relevant code:
<mx:List id="templateList" labelField="Name"
alternatingItemColors="[#EEEEEE, white]"
change="filterChanged(event)" selectedIndex="0" width="100%">
<mx:itemRenderer>
<mx:Component>
<templateFilterCheckBox/>
</mx:Component>
</mx:itemRenderer>
</mx:List>

Checkbox:
<?xml version="1.0" encoding="utf-8"?>
<mx:CheckBox selectedField="isSelected" change="onChange(event)"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.controls.List;
private function onChange(event:Event):void
{
var _templateList:List = event.currentTarget.listData.owner;
if (_templateList.selectedIndex == 0)
{
for (var i:int=0;i<_templateList.dataProvider.length;i++)
{
_templateList.dataProvider[i].isSelected = false;
}
}
else
_templateList.dataProvider[0].isSelected = false;
_templateList.invalidateList();
data.isSelected = !data.isSelected;
}
]]>
</mx:Script>
</mx:CheckBox>

What's happening is that filterChanged fires before onChange. Can be
reversed?

Thanks

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message