1. #1
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,169
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default Ext.ux.tree.RemoteTreePanel

    Ext.ux.tree.RemoteTreePanel


    I'm right now developing a taxonomy system and I was in need of a tree that would be stored at server with UI at client - I think quite common requirement, right? I've done it already before for various trees, e.g. my FileTreePanel.

    I've been too lazy to write the same code again and again so I put all basic operations into extension: Ext.ux.tree.RemoteTreePanel. The extension doesn't change appearance or behavior of the standard Ext.tree.TreePanel too much but it implements the following logic:

    1. User makes a change of the tree (create node, rename node, delete node, D&D node)
    2. Request is sent to server to execute, save this change.
    3.a) Update GUI on success
    3.b) Revert GUI to previous state on failure + display error message delivered from server.

    If you're interested see live demo at http://remotetree.extjs.eu

    All your comments, bug reports or ideas for improvements are welcome.

    Note: I cannot publish the backend of the example so it makes no sense to ask me for it. Of course, you are free to analyze what is sent to the server and what comes back and to implement your own server solution.

  2. #2
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Hi Jsakalos,

    http://remotetree.extjs.eu not work!

    Greetings,

  3. #3
    Ext User
    Join Date
    Oct 2008
    Posts
    11
    Vote Rating
    0
    Frenky is on a distinguished road

      0  

    Default


    great extend
    thanks very much!
    this is just I needed

  4. #4
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,169
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    It must had been some temporary problem - does it work now?
    Quote Originally Posted by galdaka View Post
    Hi Jsakalos,

    http://remotetree.extjs.eu not work!

    Greetings,

  5. #5
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by jsakalos View Post
    It must had been some temporary problem - does it work now?
    Oh yes. Thanks!!


  6. #6
    Sencha User
    Join Date
    Feb 2008
    Posts
    171
    Vote Rating
    0
    hpet is on a distinguished road

      0  

    Default


    @jsakalos

    Nice example.

    Can you tell how does your example handle multi-user environment. For example if multiple people have tree loaded, then one makes a change on an already altered tree structure by someone else?

    Also, if you can share, how did you manage hierarchical data in the background... and why did you choose this aproach. Standard "adjucency model" or a bit more advanced nested set model?

    Thanks again!

  7. #7
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,169
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    There is no special logic for MU environment implemented at client side.

    I don't know what's "adjucency model". I use principle similar to this: http://www.sitepoint.com/article/hie...ta-database/2/ enhanced by myself.

  8. #8
    Sencha User
    Join Date
    Feb 2008
    Posts
    171
    Vote Rating
    0
    hpet is on a distinguished road

      0  

    Default


    Thanks for reply.
    Yes, preordered tree (nested as I mentioned) is also my choice.
    By adjucency model I simply ment parent/ child relationship maintained through parent_id only.

    I am thinking about this MU issue, but then I wonder if this is realy something I should spend much time on... this may rarely happen and I guess simple error message and refresh would do. Would you agree?

  9. #9
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,169
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    I don't care too much about MU. For example, if user tries to move a branch to a node that has been deleted by another user he/she gets error message. Then he can reload the tree.

  10. #10
    Ext User
    Join Date
    Jun 2008
    Posts
    16
    Vote Rating
    0
    rusty124 is on a distinguished road

      0  

    Default


    Nifty...
    Firefox works great. In IE7 menu images are offset into the menu text.
    Attached Images