2

I am have created a selectable JQuery Dynatree object, and now what I want are two things:

  1. pass the Dynatree selection result into JSON and pass to another tree as a preview.
  2. post the JSON format data from the form to call related web services.

Any advice will be appreciated. thanks.

anIBMer
  • 1,159
  • 2
  • 12
  • 20

1 Answers1

1

You can easily see from the documentation (and in the samples page) that you can get all selected nodes by using getSelectedNodes as:

$("#tree").dynatree("getSelectedNodes")

This will get you an array of all selected nodes, which you can pass to your JSON object without tampering with this, as JSON access arrays.

To use a preview, you can check the Drag'n'drop 3 sample.

ubiquibacon
  • 10,451
  • 28
  • 109
  • 179
balexandre
  • 73,608
  • 45
  • 233
  • 342
  • thanks for this. I noticed getSelectedNodes, i thought that result will lose the actual tree structure after converted into JSON. will give it a try. – anIBMer Dec 04 '12 at 04:49
  • can u help me on this http://stackoverflow.com/questions/18050635/json-tree-with-check-box-only-for-parent-object – jackyesind Aug 05 '13 at 05:31