Loading ...
Sorry, an error occurred while loading the content.

2505Possibility of Node Sort

Expand Messages
  • dlazar911
    Jun 22, 2006
      Hi,

      With a hypothetical treeview of three nodes, labeled A, B an C. Each
      node will be a folder, and each one contains arbitrary child nodes (0,
      1 or more).

      My tree is constructed by using setDynamicLoad() for the folders, not
      the tree as a whole. A click on a folder allows the folder name to be
      edited in a text box. The edit is confirmed by sending the changes the
      the server where the backend updates the change.

      Now, to keep the tree in synch with the backend, I need to refresh the
      tree. If node B label was changed to 'Z', the folders should display
      as A, C, Z and not A, Z, C. At the moment I simply clear out the tree
      and force it to redraw, which is not ideal once the tree attains a
      larger number of nodes. Ideally, since the backend has recorded the
      change, I would like to simply sort the nodes in the tree, right in
      the DOM, to reflect the change without redrawing the whole tree.

      Could someone kindly express how this may be accomplished using the
      available methods of YUI's codebase, or point out how I might extend
      the codebase myself to do this? Any tips most appreciated.

      Thanks
    • Show all 3 messages in this topic