You wrote in the comment that one row of JSON data looks like
{"id":"13","0":"","1":"01","2":"","3":"12345","4":"asdasdasd","5":"59.67",
"6":"asd","7":"UL","8":"5","9":"04:13","10":"1","11":"40","12":"40","13":"38",
"14":"(5) 5","15":"2","16":"2","17":"2","18":"0","19":"0","20":"6","21":"24",
"22":"99","23":"1.874","24":"0_01|0",
"level":"0","parent":null,"isLeaf":false,"expanded":false,"loaded":true}
It means that the format of data corresponds not repeatitems: true
inside of jsonReader
. Only because of the feature Autotedection of JSON format introduced in jqGrid 4.4.5 and fixed in jqGrid 4.5.0 (see here and here) the grid will be filled. So I recommend you to use jsonReader
with repeatitems: false
or at least remove repeatitems: false
which don't corresponds your data format.
To set expanded
and loaded
column you should use
row.expanded = index >= 0; // set expanded column
row.loaded = true; // set loaded column
instead of
row[30] = index >= 0; // set expanded column
row[31] = true; // set loaded column
Additionally you should use row.id
instead of row[0]
(see index = $.inArray(row[0], idsOfExpandedRows)
in the code).
Probably you will need make more changes like above. I can't tests the code, so the above changes could be not full. In any way the above changes are really required.
Additionally I would be very careful with usage of integers as the column names. I would better change the names of columns from "0"
, "1"
, ..."24"
to for example "c0"
, "c1"
, ..."c24"
which more corresponds to names of identifiers and protect you additionally from id duplicates with rowids which you have also as integers (see "id":"13"
and "13":"38"
). It could save much your time in the future.