ExtJS TreeLoader 问题
我对 ExtJS 不太熟悉,但正在开发一个使用它的项目。
我们使用带有 TreeLoader 的 TreePanel,在一次调用中从服务器加载所有节点数据。我们有一个事件,我需要访问树中每个节点的属性。我这样做的方法是使用 TreePanel 的 getNodeById 方法。问题是树面板似乎延迟加载节点,并且无法使用 getNodeById 检索节点,除非该节点已经加载。
有没有办法强制加载所有节点?我最接近的是使用 TreeLoader 上的 preloadChildren 属性,但这仍然仅在加载包含子节点的父节点时加载。
I'm not too familiar with ExtJS, but am working on a project that uses it.
We are making use of a TreePanel with a TreeLoader that loads all node data from the server in one call. We have an event in which I need to access the attributes of every node in the tree. The way I am doing this is using the TreePanel's getNodeById method. The problem is that the tree panel seems to lazily load nodes and will not be able to retrieve a node with getNodeById unless the node has already been loaded.
Is there any way to force all nodes to be loaded? The closest I've come is by using the preloadChildren attribute on the TreeLoader, but this still only loads when the parent node containing children is loaded.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望能够访问所有节点,则必须在第一次调用时加载完整的树结构。
第一次调用的 JSON 响应应包含所有树节点。例如:
}]
If you want to be able to access all the nodes, you must load the complete tree structure on the first call.
The JSON response on the first call should include all the tree nodes. For example:
}]