flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark goldin <markzolo...@gmail.com>
Subject Flex - Disable an item with checkbox in List
Date Fri, 17 Jun 2016 16:11:05 GMT
I have a List with checkboxes. I wan to disable some items based on List's
data.

Here is my List:

<mx:List id="templateList" width="100%" alternatingItemColors="[#EEEEEE,
white]"
labelField="Name" selectedIndex="0">
<mx:itemRenderer>
<mx:Component>
<templateFilterCheckBox/>
</mx:Component>
</mx:itemRenderer>
</mx:List>

<?xml version="1.0" encoding="utf-8"?>
<mx:CheckBox selectedField="isSelected" change="onChange(event)"
enabled="{data.enabled}"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
private function onChange(event:Event):void
{
data.isSelected = !data.isSelected;
var _changeComplete:Event = new Event("filterChangeComplete", true);
dispatchEvent(_changeComplete);
}
]]>
</mx:Script>
</mx:CheckBox>

I have set data.enabled to false for all items just for testing. None of
checkboxes come out disabled. The data provider is an AraayCollection and
bindable.
Any idea what is missed?

Thanks

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