开发者

Showing/Managing a list of files/directories in Javascript?

I'm looking for a way to show a list of directories and files in them using javascript. The kind of structure I want is:

  • Directory 1

    • File 1
      • Path
      • Action taken (deleted, added, modified)
    • File 2
      • Path
      • Action taken (deleted, added, modified)
  • Directory 2

    • File 1
      • Path
      • Action taken (deleted, added, modified)
    • File 2
      • Path
      • Action taken (deleted, added, modified)
    • Sub Directory 1
      • Subdirectory File 1
        • Path
        • Action taken (deleted, added, modified)
      • Subdirectory File 2
        • Path
        • Action taken (deleted, added, modified)

etc. What I'm looking for is:

1) How to loop through all 开发者_如何学运维the items that I have.

2) How to display them in a tree.

3) How to easily get a list of all children of a parent, for selecting/deselecting. (E.g if user clicks the name 'Directory 1', then all children of that directory (files, subdirectories, subdirectory files etc) will have the checkbox next to them selected/unselected.

Any ideas? Thanks.


I'm yet to find a nice js tree implementation.

jsTree is strong enough to build off it the functionality you want, although I find it very unintuitive and hard to use and customise. There is a reasonably active message board which can help. The author has been promising a rewrite for about a year, and posted that there will be commits coming soon, although if you look at the message board history he's been saying that for like 6 months, at least.

I haven't found anything better than jsTree, and I don't really like it, so I wish you luck.

I think a tree widget is on the wishlist for jqueryui, but don't hold your breath. This is supposed to be the repo I think.

And there's this. No idea if it's any good, just found it when I was looking for the jqueryui links. (Looks like there haven't been commits since 2009, probably not the best idea to pick it up then...)

If you find something nice, please post it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜