Question

I am using (jquery) dynatree with struts. The items on the tree will be created this way:

  1. On right click of a node, a context menu shows with options like [create, modify and delete]. On click of "Create", a pop up shows which contains input fields for data capture.
  2. when save is clicked on the pop up, the record is created using ajax and the tree is refreshed.
  3. On creation of the record, the record should send to the server the id of the parent node which is usually the primary key of the parent node's data stored on the server or database.
  4. This action can be performed on every node.
  5. Each node should be able to store the id of the parent.
  6. Each node or child node should also know it's level on the tree. i.e. Child node one has a level of 1. Thanks
Was it helpful?

Solution

I can't really help you because you did not post any code and stackoverflow is not the place to ask someone to write code for you.

What I would suggest doing is going to the Dynatree Example Page and looking at all the different tree examples they have posted there. Under each tree example there is source code for that particular example. Pick the example that best represents what you want to do in your project, and then try to modify it to what you exactly want. Then when / if you have problems, edit your post with code so we can help you.

Also you can check out these pieces of documentation that will help you.

Dynatree Documentation
jQuery Documentation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top