0

I'm using jQgrid's TreeView mode.

My problem is that the parent's children is positioned under the parent sibling in the tree.

This is a known issue? any solution?

Thanks

Yair Nevet
  • 12,725
  • 14
  • 66
  • 108
  • One uses the word [TreeGrid](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:treegrid) instead of TreeView in jqGrid documentation. – Oleg Mar 21 '12 at 16:42

1 Answers1

0

You should set level property for the children (in the data which will be used to fill the grid) to the level of the parent +1. See here an example.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Hi, the level is ok but the problem is thatg we have multiple siblings in the same level and when adding children to the first sibling it positioned the new child under the parent's last sibling. For example: 1 1.1 1.2 1.3 when we add children to node 1.1 , the child appears under 1.3 – Yair Nevet Mar 21 '12 at 16:48
  • @Yair: The `level` defines the offset from the left. Probable you should include more information in the text of your question. For example the data which you use to fill the TreeGrid and the screenshort which shows your problem. If you have problem only if you *add* new node you should post the code which shows *how* you add it. – Oleg Mar 21 '12 at 16:57
  • I will provide u more info letter. – Yair Nevet Mar 21 '12 at 17:07
  • Could it maybe be for some reason because of the records order in the json data? – Yair Nevet Mar 22 '12 at 08:28
  • @Yair: First of all I am not sure what the problem you have. You description is not clear enough. Either you have problem with the `level` property or you have the problem because of the wrong order of data which you fill in the grid. It's important that you have to place children immediately after the parent. If you place the children after another tree node the children will be shown on the wrong place. jqGrid **don't** reorder items if it place there in TreeGrid. – Oleg Mar 22 '12 at 08:34