简体   繁体   English

JavaScript中的动态树结构

[英]Dynamic tree structure in JavaScript

For my application i need to create one tree structure which consist of nested folder which will grow depends open server reponse. 对于我的应用程序,我需要创建一个由嵌套文件夹组成的树结构,该文件夹将根据开放服务器的响应而增长。 just like an email has tree structure- 就像电子邮件具有树状结构一样

inbox or sent or draft or outbox(f)/a(f)/some content 
inbox or sent or draft or outbox(f)/a(f)/b(f)/email  content
inbox or sent or draft or outbox(f)/email  content

and other possible combination. 和其他可能的组合。 since i will get this path from the server so i have to loop it and create appropriate structure..can you guys please help me in it.. thanks in advance. 因为我将从服务器获取此路径,所以我必须将其循环并创建适当的结构..你们能帮助我吗..预先感谢。

This is going to be considerably easier to do cross browser using a JavaScript framework (I know this appears to be a standard answer at the moment, but it is a good answer in this case)... use jQuery! 使用JavaScript框架进行跨浏览器的操作将变得非常容易(我知道目前这似乎是标准答案,但在这种情况下是一个很好的答案)...使用jQuery!

There is a treeview plugin that does exactly what you need, with lots of options too. 有一个treeview插件可以完全满足您的需求,并且还有很多选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM