12 Dec 2008 4:13 AM #1
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.
14 Dec 2008 2:15 AM #2
14 Dec 2008 3:37 AM #3
thanks very much!
this is just I needed
14 Dec 2008 9:57 AM #4
14 Dec 2008 11:48 AM #5
15 Jan 2009 8:19 AM #6
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?
15 Jan 2009 8:55 AM #7
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.
15 Jan 2009 9:29 AM #8
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?
15 Jan 2009 9:36 AM #9
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.
15 Jan 2009 10:36 AM #10
Firefox works great. In IE7 menu images are offset into the menu text.