可靠的 HTML/Ajax 控件来操作树结构?
有人可以推荐一个可靠且支持树操作的 HTML 树控件吗? 我需要它作为后端,并且想要移动、重新排序、删除、添加和重命名节点。
现在,我在数据库中使用嵌套集模型来存储树结构,并使用 dhtmlxTree(请参阅 dhtmlx.com)作为树控件。 我遇到的问题是这个控件需要数据库中的一个额外字段来存储它自己的寻址模式(类似于 0_2_14,这是从根到该项目的路径)。这是一个非常糟糕的主意,因为这意味着每当位置发生变化时,整个树就会变得无效(因为它同时使用这个字符串作为 ID 和地址/位置),我必须重新计算每个节点,关闭树并从服务器重新加载它。这让用户很烦恼,因为他们每次都必须将树重新打开到之前所在的位置。文档说这个树控件确实可以预先选择/打开给定地址的树,但是这个功能对我不起作用 - 每当用户打开一个节点时,我使用 ajax 调用只轮询节点的直接子节点,并且由于某种原因,在这种情况下它不会让我在加载时打开节点。该文档很糟糕,它只有很少的基本代码示例来实现某些功能,所以我被困在这里。 我的问题是是否有任何好的替代方案,其自身的寻址方案没有问题并允许编辑。还会考虑 Flash 或 Java 应用程序。
Can someone recommend a reliable HTML tree control that also supports tree manipulation?
I need it for a backend and want to move, reorder, delete, add and rename nodes.
Right now I use a nested set model in my database to store the tree structure, and dhtmlxTree (see dhtmlx.com) as tree control.
The problem I'm having is that this control needs an extra field in the database to store its own addressing schema (something like 0_2_14, that's the path to this item from root). This is a pretty bad idea, because it means whenever the position changes the whole tree becomes invalid (since it uses this string as ID and adress/position at the same time), I have to re-calculate each node, close the tree and reload it from the server. This annoys the users, because they have to reopen the tree each time to the place they where before. The documentation says this tree control can indeed pre-select/open the tree to a given address, however this feature is not working for me - I use ajax calls to poll only the immediate child for a node whenever the user opens a node, and for some reason it wont let me open a node on load in that case. The documentation is crap and it only has very few and basic code examples for some functions, so im stuck here.
My question is if there are any good alternatives out there, that don't have issues with it's own addressing scheme and allow edits. Would also consider a flash or maybe java app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://plugins.jquery.com/plugin-tags/tree
http://www.jstree.com/
看看上面的是否有用。
http://plugins.jquery.com/plugin-tags/tree
http://www.jstree.com/
see if the above one is useful.