如何将 TileList 中项目的可见性设置为 False
我在 Flex 3 网站中有一个tileList。我想以编程方式关闭图块的可见性。例如:
<mx:ArrayCollection id="myAC">
<mx:Array>
<mx:Button id="first" label="1" />
<mx:Button label="2" />
<mx:Button label="3" />
<mx:Button label="4" />
</mx:Array>
</mx:ArrayCollection>
<mx:TileList
id="myTL"
dataProvider="{myAC}"
width="400"
height="400"
columnCount="2"
rowCount="2"
/>
<mx:Button id="turnOffVisibility" click="visibleOff(event)" />
private function removey(event:MouseEvent):void {
myTL.getChildAt(0).visible=false;
}
我无法“抓取” arrayCollection 中的第一项并将其可见性设置为 false。
我做错了什么?有什么建议吗?
谢谢。
-拉克斯米迪
I've got a tileList in a Flex 3 website. I want to programmtically turn off the visibility of a tile. So for example:
<mx:ArrayCollection id="myAC">
<mx:Array>
<mx:Button id="first" label="1" />
<mx:Button label="2" />
<mx:Button label="3" />
<mx:Button label="4" />
</mx:Array>
</mx:ArrayCollection>
<mx:TileList
id="myTL"
dataProvider="{myAC}"
width="400"
height="400"
columnCount="2"
rowCount="2"
/>
<mx:Button id="turnOffVisibility" click="visibleOff(event)" />
private function removey(event:MouseEvent):void {
myTL.getChildAt(0).visible=false;
}
I'm not able to "grab" the first item in the arrayCollection and set its visibility to false.
What am I doing wrong? Any suggestions?
Thank you.
-Laxmidi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
dataProvider 不是控件的集合。它是描述对象的集合。实际上呈现在 TileList 内部的是 itemRenderer。我猜你的意思是
Tile
而不是 TileList?如果是这样,只需将按钮放在 Tile 中并直接控制它们即可。dataProvider is not collection of controls. It is collection of description objects. It is itemRenderer who actually present inside of TileList. I guess you mean
Tile
instead of TileList? If so, just put your buttons in Tile and control them directly.从 dataProvider 中删除该项目,List 控件将相应更新。
Remove the item from the dataProvider, and the List control will update correspondingly.