PDA

View Full Version : How do I build a tree on the client and the save it to the server as a 'create'?



el_chief
23 Jul 2012, 5:35 PM
Let's say I build the following tree (on the client, using a TreePanel):


ParentA
|
---ChildA
|
ParentB
|
---ChildB


If I don't set the ids, ChildA and ChildB both have parentId of null

If I use idgen:'uuid', then they get ids, but when I save the tree it uses the "update" API URL, as it is no longer considered phantom.

So, the question is, how do I create a nested tree and save it to the server?

Without IDs, I need to send the whole tree up at once. How do I get the whole tree in JSON?

Thanks!