-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathminiResIR.mxml
46 lines (39 loc) · 1.17 KB
/
miniResIR.mxml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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"
autoDrawBackground="true">
<s:layout>
<s:HorizontalLayout verticalAlign="middle" padding="5"/>
</s:layout>
<s:states>
<s:State name="normal"/>
<s:State name="selected"/>
</s:states>
<fx:Declarations>
</fx:Declarations>
<fx:Script>
<![CDATA[
import flash.utils.setTimeout;
import mx.events.FlexEvent;
import mx.events.ItemClickEvent;
import spark.components.List;
protected function catCheck_changeHandler(event:Event):void
{
if (resCheck.selected) {
data.selected = true;
} else {
data.selected = false;
}
var parentList:List = owner as List;
var e:ItemClickEvent = new ItemClickEvent(ItemClickEvent.ITEM_CLICK, true);
e.item = data;
e.index = parentList.dataProvider.getItemIndex(data);
e.label = "selected";
dispatchEvent(e);
}
]]>
</fx:Script>
<s:CheckBox id="resCheck" change="catCheck_changeHandler(event)" selected="{data.selected}"/>
<s:Label text="{data.name}"/>
</s:ItemRenderer>