s:List ,如何清除它的内容
我里面有孩子,我想知道如何从内容中清除它,动态添加后删除所有孩子。 谢谢。
I have with children inside it and I wanted to know how do I clear it from contents, delete all children after they were added dynamically.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以只设置一个空的 dataProvider -
list.dataProvider = new ArrayCollection();
另一种方法是清空现有的 dataProvider:
list.dataProvider.removeAll();
You can just set an empty dataProvider -
list.dataProvider = new ArrayCollection();
Another way is to empty the existing dataProvider:
list.dataProvider.removeAll();
您可以使用
List
的Listid.removeAllChildren()
函数简单地删除所有子项。You can simply remove all the children by using the
Listid.removeAllChildren()
function ofList
.如果您有 arraycollection 使用:
myAC.removeAll;其中 myAC 是您的 arrayCollection 的 id。
但也许你正在使用数组?
然后使用函数:
我希望这有帮助:)
If You have arraycollection use:
myAC.removeAll; where myAC is id of Your arrayCollection.
But mayby You are using array?
Then use function:
I hope this helps :)