Flex:以编程方式扩展 AdvancedDataGrid 树列
有谁知道如何以编程方式扩展 Flex 中 AdvancedDataGrid 树列的节点? 如果我使用一棵树,我会使用类似这样的东西:
dataGrid.expandItem(treeNodeObject, true);
但我似乎无权访问 AdvancedDataGrid 中的此属性。
Does anyone know how to programmatically expand the nodes of an AdvancedDataGrid tree column in Flex? If I was using a tree I would use something like this:
dataGrid.expandItem(treeNodeObject, true);
But I don't seem to have access to this property in the AdvancedDataGrid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
AdvancedDataGrid 也有一个 ExpandItem() 方法:
http: //livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGrid.html#expandItem()
AdvancedDataGrid has an expandItem() method too:
http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGrid.html#expandItem()
复制在上述 url 中找到的示例并调用此函数:
Copy the sample found at the aforementioned url and call this function:
您还可以通过使用游标遍历 dataProvider 来打开节点。 以下是我打开指定级别的所有节点的方法:
You could also open nodes by iterating through the dataProvider using a cursor. Here is how I open all nodes at a specified level:
想在此处添加一点,尽管 AdvancedDataGrid 有
expandAll()
方法,但它有一个名为displayItemsExpanded
的属性,该属性设置为true
将展开所有节点。为了扩展特定的子项,可以使用
expandChildrenOf()
和expandItem()
方法,这可以从上面给出的链接中进行验证。Would like to add here that the AdvancedDataGrid, in spite of having an
expandAll()
method, has a property calleddisplayItemsExpanded
, which set totrue
will expand all the nodes.For expanding particular children, the
expandChildrenOf()
andexpandItem()
methods can be used, as can be verified from the links given above.