jqGrid TreeGrid 在展开时从 JSON 服务加载子节点的示例
基本问题是我有一个 TreeGrid,它有大量节点(超过 6k),并且我希望能够在用户展开节点时加载分支,而不是一次加载所有节点。
我知道这在 jqGrid 中是可能的(文档表明措辞非常糟糕 http ://www.trirand.com/jqgridwiki/doku.php?id=wiki:adjacency_model )但我无法弄清楚我需要的精确的 jqGrid 设置集让它做到这一点。
我确实有一个功能性的 TreeGrid,它将从“url”参数加载所有记录,因此我需要的唯一技巧是它仅单独加载顶部节点,然后在单击 ExpandRow 时加载它的子节点。
The base problem is I have a TreeGrid that I has a significant number of nodes (over 6k) and I want to be able to load a branch when the user expands a node rather than loading all at once.
I know this is possible in jqGrid (the documentation indicates so just very poorly worded http://www.trirand.com/jqgridwiki/doku.php?id=wiki:adjacency_model ) but what I can't figure out is the precise set of jqGrid settings I need to make it do that.
I do have a functional TreeGrid that will load all records from the 'url' parameter, so the only trick I need is for it to only load the top node alone, and then load it's children when I click the ExpandRow.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己想出来了:
第一个关键是在我不想加载的子节点中设置
loaded=false
。然后我需要用正确的节点响应 jqGrid 在已卸载的节点上发送的请求。Figured it out myself:
The first key is setting
loaded=false
in the child nodes I don't want loaded. Then I need to respond the request jqGrid sends on unloaded nodes with the right nodes.