PDA

View Full Version : Two Trees DnD with save moved file



southside
27 Sep 2007, 7:40 AM
Anyone;

Iam new to this and trying to learn so bear with me if this is an elementary question.

Iam testing the two-tree.html example.

I see that the left Ext JS tree is derived from the extjs/source folder.

My question is if I drag files from the left tree and drop on the right tree eg My Files, where is that file then moved to.

I think in the example it is maybe not moved and saved as a refresh undoes the move.

Can anyone advise what I need to do to save the file into the My Files location.

I want to create a drag and drop from local files on left to remote files on right, kind of like an ftp but for a different solution.

SC

Animal
28 Sep 2007, 12:22 AM
What I think you are asking is how to either inform the server on tree drag/drop gestures or save the tree state.

It's up to you to either react to http://www.extjs.com/deploy/ext/docs/output/Ext.tree.TreePanel.html#event-nodedrop events and make an Ext.Ajax call to the server to perform the action immediately.

Or, you can just let all the drag/drops take place and use a TreeSerializer to serialize the Tree, (Do a forum search) and then Ext.Ajax to pass the new state of the tree back to the server.

southside
28 Sep 2007, 1:07 AM
Animal;

Thanks for the reply - will have a look and try to understand.