我有一个 Spark.List 的自定义 itemrenderer
<?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:states>
<s:State name="normal"/>
<s:State name="selected"/>
<s:State name="hovered"/>
</s:states>
<s:CheckBox label="{data.name}" selected.selected="true" selected.normal="false"/>
</s:ItemRenderer>
名单:
private function get UOAbilitate():List
{
var l:List = new List();
l.dataProvider = listaUOA;
l.allowMultipleSelection = true;
l.itemRenderer = new ClassFactory(CheckBoxItemRenderer);
return l;
}
[Bindable]private var listaUOA:ArrayCollection = new ArrayCollection([
{name: "Uo1"},
{name: "Uo2"},
{name: "Uo3"},
{name: "Uo4"},
{name: "Uo5"},
{name: "Uo6"},
{name: "Uo7"},
{name: "Uo8"},
{name: "Uo9"},
{name: "Uo10"},
{name: "Uo11"},
{name: "Uo12"}
]);
复选框以正确的方式运行。如果我选择了一个值,那么选择另一个值将导致选择新值并取消选择旧值..
使用 CTRL 两个项目保持选中状态..我将获得相同的结果而无需按 ctrl 键...