DOJO:LazyTreeGrid 中的延迟加载节点 - 寻找示例代码
我正在寻找如何将 QueryReadStore (或其他一些商店)与 dojox.grid.LazyTreeGrid 一起使用的示例?
我希望能够显示大型结构并仅从服务器加载必要的数据。 仅应从专用服务器脚本加载开放节点的子节点。
我已经将 QueryReadStore 与 dojox.grid.DataGrid 一起使用,效果很好:)
帮助,谢谢。
I'm looking for an example of how to use QueryReadStore (or some other store) with dojox.grid.LazyTreeGrid ?
I want to be able to display big structures and load only necessary required data from server.
Only children of open nodes should be loaded from dedicated server script.
I'm already using QueryReadStore with dojox.grid.DataGrid and it works great :)
Help, Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是基于我目前正在做的一些事情的冗长解释/示例。
这假设您对 Dojo 1.7 风格的包有基本的了解(例如,我们假设默认的 Dojo 包已正确设置)。
客户端(js 文件)
服务器端:
您需要一个服务器端处理程序来侦听 url/to/load/rows 上的 GET 请求。这些请求最多有 3 个参数:
该处理程序可以用您最喜欢的服务器端语言(即带有 ASP.Net MVC、Ruby 等的 C#)编写。
您的服务器处理程序的工作将是返回一个 json 结构,其中包含以下 3 个属性:
客户端/服务器通信
在我之前的示例的基础上,一旦网格启动(客户端),它将请求类似以下内容:
服务器将返回以下内容:
网格将显示 2 个水果。
apple
将有一个 Expando,但没有watermelon
(由于children
属性)。假设用户单击
apple
展开。网格将请求其子项:服务器可能返回类似以下内容:
然后,网格将在
apple
行下显示一个子项。Here is a long-winded explanation/sample based on some stuff I am currently doing.
This assumes basic comfort with Dojo 1.7-style packages (for instance, we assume the default Dojo packages are correctly set-up).
Client-side (js file)
Server-side:
You need a server-side handler that will listen to GET requests on
url/to/load/rows
. Those requests will have up to 3 parameters:That handler can be written in your favorite server-side language (i.e. C# with ASP.Net MVC, Ruby, etc.)
The job of your server handler will be to return a json structure containing the following 3 attributes:
Client/Server communication
To build upon my previous example, as soon as the grid is started-up (client-side), it will request something like:
The server would return the following:
The grid will display the 2 fruits.
apple
will have an expando, but notwatermelon
(due to thechildren
attribute).Assume the user clicked on the
apple
expando. The grid will request its children:The server could return something like:
The grid will then display a single child under the
apple
row.我想我这里有你要找的东西。一些关于将 QueryReadStore 与 dojox.grid.LazyTreeGrid 一起使用的优秀示例代码,并且也一步一步地进行了充分解释。
请参阅此处:http://livedocs.dojotoolkit.org/dojox/grid/LazyTreeGrid
我希望这能促进您的工作并能够实现您的目标。
问候
弗兰克。
I think I have what you are looking for here. Some excellent example code on using QueryReadStore with dojox.grid.LazyTreeGrid, and it's fully explained step by step too.
Please see here: http://livedocs.dojotoolkit.org/dojox/grid/LazyTreeGrid
I hope this advances your work and you are able to accomplish your goals.
Regards
Frank.