Checkboxes tree POST


I would like to ask how can i post every child with his parent in front so that i can recognize the parent that a child is coming from. I’m asking that because i have the same childs in a lot of different parents. For example,


where 1,2 parents and a,b,c childs. I want in post if i select for example 1a and 2a to show 1.a, 2.a and not just a,a,1,2



i have the same childs in a lot of different parents

ids must be unique. If you loaded the item with the id that already exists in tree, the random seed will be added to the id automatically.

Thank you for your reply. I understand that every child has a unique id. The data i use to generate the tree come from a db and i want to know if i can post a string in that form: “Parent.child” instead of getting just the id’s because i don’t want to create a new column with all the different id’s. I use the tree in a php form and i want to use the post result to search in the db for the results. So i want to take the request in a string and split it. If you think there is a better or easier way please let me know. Thank you for your time.

When node is saved on the server side, responce from sever side should has following format:

where tid - the ID of the row after the operation (may be the same as gr_id, or some different one - it can be used during a new row adding, when a temporary ID, created on the client-side, is replaced with the ID, taken from the DB or by any other business rule).

Thanks a lot for the responses. I really apreciate it. I managed to come through my problems with the tree and the id’s. Every node has a unique id now so no prob with that. My question now is how to get the checkbox tree values from a php form. I have a form with action get and when i click submit i get the values from a date picker i use but i can’t get the tree values. I want to get the values in a string in order to use them to parse data from a db. Thanks in advance.

You can serialize tree to xml and then send this sting to server side. To serialize tree with information about checked rows you should set 2nd parameter of setSerializationLevel() to “true”:

var xml=tree.serializeTree();

My question remains. When i click submit in my form how can i store the checked nodes in a string, let’s say $result. Then with echo $result; i want to see the checked nodes i see with alert(tree.getAllChecked()); By the way, the tree is loaded from a mysql db in json format not xml. Thanks again.

When i click submit in my form how can i store the checked nodes in a string
You can serialize tree to the XML or JSON format, set this string as value of hidden filed and submit in your form