0

I have a JS file tree where i can delete, rename, add new files using ajax... I'm wondering what is the best way to update it when a file is deleted or a new one item is created or moved:

Reload the whole tree but it can be a problem when it's big and slow to load

Reload only a part of it but how?

On delete for example delete the html part releated to it if ajax is ok

I'm using the third option now but i don't think its the best way right?

I'm using jquery and php on server side and this file tree a bit modified http://abeautifulsite.net/blog/2008/03/jquery-file-tree/

Matteo Pagliazzi
  • 5,140
  • 12
  • 49
  • 83
  • 1
    If the tree's JavaScript does not support adding/removing nodes, find one that does. – epascarello Dec 03 '11 at 14:01
  • Why reinvent the wheel? You showed you were using tree code already from some blog, thought you could pick one already that handles it. :) – epascarello Dec 05 '11 at 22:40

1 Answers1

1

Its better to update the part of the tree not the whole tree. Here is a nice example where its done using jquery.

Shiplu Mokaddim
  • 56,364
  • 17
  • 141
  • 187