我正在使用'Tilelist'和'HBOX'作爲itemrenderer。在HBOX中我有複選框。帶有複選框的Itemrenderer中的選擇不正確
將arraycollection作爲dataprovider傳遞給TileList(我的arraycollection長度爲20)。在選擇Tilelist中item1的複選框並滾動列表時,我可以看到隨後的item從item1被選中。在我發現的博客中,使用複選框時存在一些彈性緩存問題。
需要一些幫助。
預先感謝您。
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="0" xmlns:local="*" height="500" >
<mx:Script>
<![CDATA[
private var arr:Array = [
{ firstName: "Alex", lastName: "Harui" },
{ firstName: "Gordon", lastName: "Smith" },
{ firstName: "Deepa", lastName: "Subramanian" },
{ firstName: "Matt", lastName: "Chotin" },
{ firstName: "Ely", lastName: "Greenfield" },
{ firstName: "Kevin", lastName: "Lynch" },
{ firstName: "Shantanu", lastName: "Narayan" },
{ firstName: "Joan", lastName: "Lafferty" },
{ firstName: "Ryan", lastName: "Frishberg" },
];
]]>
</mx:Script>
<mx:TileList id="list" initialize="list.dataProvider=arr" labelField="lastName" maxColumns="1" itemRenderer="Checkrenderer"
allowMultipleSelection="true" >
</mx:TileList>
</mx:Application>
Checkrender HBOX:
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="138" height="300" xmlns:local="*">
<mx:CheckBox id="checkbx"/>
</mx:Box>
</mx:HBox>
是否使用項目渲染器?你能發佈你的代碼嗎?你可能需要重寫'public function set data(value:Object)' – 2012-03-22 15:59:35
Checkrenderer代碼: \t \t \t的 \t <本地:CheckBoxRenderer ID = 「checkbx」/> \t –
user1285835
2012-03-22 16:38:02