Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.ok-soft-gmbh.com/jqGrid/AddRowInTreeGrid.htm" rel="nofollow noreferrer">The demo</a> shows how to use <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:treegrid#methods" rel="nofollow noreferrer">addChildNode</a> method to add tree node. I added in the JSON data which you posted the <code>"loaded":true</code> part because I use in the test no server components and I want to load the treegrid at once.</p> <p>To show that you should be very careful with ids of the new added row I added two buttons in the demo: "Insert tree node" and "Insert tree node with unique rowid". The first button use the id="1113" from the data which you posted. One click on the button work correct. the second click will insert rows having id duplicates which will be an error. The error you can see different in different web browsers. The second button use <code>$.jgrid.randId()</code> to generate unique rowid. It is probably not an option in your scenario, but it works perfect in case of <em>local</em> tree grid (like in my demo).</p> <p>Another problem is that you use "parent":"0" in your demo for the root elements. Correct will be <code>"parent":null</code> or <code>"parent":"null"</code> (see <a href="https://stackoverflow.com/questions/7330572/sorting-of-jqgrid-v4-1-2-treegrid-not-working-with-ajacency-model/7332627#7332627">the answer</a>). Moreover the property with the name <code>"parent_id"</code> will be ignored. I removed from the demo some settings, so that local sorting can be used in the treegrid.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload