我有一个List ItemRenderer。当我点击一个按钮时,绑定到列表的ArrayCollection I的一个属性被改变。ItemRender数据变化
当我点击按钮,它确实会改变属性,但列表不会改变。
我该如何解决这个问题。
这里是我的代码
<fx:Script>
<![CDATA[
[Bindable]
public var controllers:ControllerCollection = new ControllerCollection();
private function hideTheFirstItem(evt:MouseEvent):void
{
(controllers[0] as Controller).meetsRequirements = false;
//these methods don't work unfortunatly
controllers.itemUpdated(controllers[0]);
controllers.refresh();
}
]]>
</fx:Script>
<mx:List id="listControllers" dataProvider="{controllers}">
<mx:itemRenderer>
<fx:Component>
<solutionItems:displaySolutionItem visible="{data.meetsRequirements}" />
</fx:Component>
</mx:itemRenderer>
</mx:List>
<mx:Button label="test" click="hideTheFirstItem(event)" />
(ControllerCollection延伸的ArrayCollection)
谢谢!
文森特
请显示您的项目渲染器。此外,ControllerCollection的外观如何? – 2011-05-09 14:53:29
感谢您的回复。 ControllerCollection实际上只是一个ArrayCollection。在itemrender中没有什么特别的。我将添加代码。 – Vinzcent 2011-05-09 15:15:18