Can anyone please tell me the XML structure for sub-items that jqgrid uses. I’ve read the documentation and it does not explain clearly how one would create a tree view with sub-items in it. Basically I have a 2 column grid with 3 levels.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From the demo:
http://www.trirand.com/jqgrid35/jqgrid.html
(under new in version 3.3->tree grid)
It makes this ajax call as a post:
http://www.trirand.com/jqgrid35/server.php?q=tree
The post parameters looks like:
Which returns exactly this:
For each sub row it makes another ajax call. The first “cell” element specifie the row number. When there is a gap before the next row id, it knows that it has subitems, and will put an expander for that row. When the user selects the expander, it makes another ajax call, and the following is returned:
Looking at the source, it specifies column names, and it’s expecting them to be returned in order. I’m pretty sure you can write this to not expect a particular order, but that’s how the mapping is set. This is pretty much a clone of the way ext does things, which is a good way to follow because they do it well.
And, for completeness, lets include the PHP source example (went through this much trouble, might as well finish it off!):