本文介绍了Flex:树组件:在数据提供者更新时保持状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将如何保持树控件的状态?我想在数据提供者更新时保持树的状态,而不是崩溃.
解决方案
这样的事情怎么样 :
var openItems:Object = tree.openItems;tree.dataProvider = myNewDataProvider;tree.openItems = openItems;树.validateNow();如果新的 dataProvider 与旧的完全不同,我不确定这将如何工作,但是当您延迟加载树节点时它会工作.
How would I go about keeping the state of a tree control?I'd like to keep the state of the tree when it's data provider gets updated, instead of it collapsing.
解决方案
How about something like this :
var openItems:Object = tree.openItems; tree.dataProvider = myNewDataProvider; tree.openItems = openItems; tree.validateNow();
I'm not sure how well this will work if the new dataProvider is radically different from the old one, but it works when you're lazy loading tree nodes.
这篇关于Flex:树组件:在数据提供者更新时保持状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!