JqGrid: Reload Data From Json-string
Solution 1:
It's very seldom that you really need to use datatype
which values other as "local"
, "json"
, "jsonp"
or "xml"
. Most usage of other datatype
can be easy replace to the tree main datatypes. If you use "jsonstring"
, "xmlstring"
or "clientSide"
then the datatype
will be changed to "local"
after loading of data (see the line of source code for example). So if you really need to use datatype: "jsonstring"
you can fix reloading by usage
$("#grid").setGridParam({
datastr: myNewData,
datatype: "jsonstring" // !!! reset datatype
}).trigger("reloadGrid");
Additionally I could see that you used pager: false
option of jqGrid. It's wrong option. If you don't need to use local paging of data I recommend you
- don't include and
pager
option. Default valuepager: ""
is already OK. - include
rowNum
parameter with some large enough value likerowNum: 10000
. Default value ofrowNum
is 20. So if you don't want to display only the first 20 rows of the input data you should increase the value ofrowNum
.
The last recommendation: you should include sorttype: "integer"
(see the documentation) to columns which holds integer values. It will fix sorting of data if the user clicks on the column header. You should consider to use column templates too (see the old answer).
Post a Comment for "JqGrid: Reload Data From Json-string"