Forum
23:31
30/09/2010
Hello,
mystr =
"{" +
"total: '1'," +
"page: '1'," +
"records: '1'," +
"rows : [" +
"{id:'1', cell:['cell00711','cell12','cell13','cell12','cell13']}" +
"]" +
"}";
jQuery("#process_list")
.jqGrid("setGridParam", {datastr:mystr})
.trigger("reloadGrid");
The grid load data with no problem from an URL.
I've set datastr: mystr and datatype: 'jsonstring'. No JS error but the grid don't load new data.
I've the same problem with 3.7.
Any Idea ?
Thanks for your help.
00:43
10/08/2009
Hello!
You used before wrong JSON data. Corresponds to http://www.json.org/ all strings must be double-quoited:
{
"total": "1",
"page": "1",
"records": "1",
"rows" : [
{"id":"1", "cell":["cell00711","cell12","cell13","cell12","cell13"]}
]
}
So fix your code and it will work. I recommend you validate your JSON data in http://www.jsonlint.com/.
Regards
Oleg
01:47
30/09/2010
mystr = "{\"total\":\"1\",\"page\":\"1\",\"records\":\"1\",\"rows\" : [{\"id\":\"1\", \"cell\":[\"cell00711\",\"cell12\",\"cell13\",\"cell12\",\"cell13\"]}]}"
jQuery("#process_list")
.jqGrid("setGridParam", {datastr:mystr})
.trigger("reloadGrid");
same problem with a validated string.
Grid reload but with previous data.
another idea ?
01:49
30/09/2010
my jqGrid definition
$("#process_list").jqGrid({
datatype: 'jsonstring',
datastr: mystr,
colNames:['id','Pid','PPid', 'Name', 'Path','CmdLine'],
colModel:[
{name:'id', index:'id', width:0},
{name:'pid', index:'pid', width:50},
{name:'ppid', index:'ppid', width:50},
{name:'name', index:'name', width:150},
{name:'path', index:'path', width:250},
{name:'cmdline',index:'cmdline',width:300}
],
sortname: 'pid',
viewrecords: true,
sortorder: "desc",
multiselect: false,
caption:"Process list"
});
09:07
Moderators
30/10/2007
Hello,
In your case you have set 5 records, but your definition in colModel has 6 fields.
Pleadse read this carefully:
http://www.trirand.com/jqgridw.....#json_data
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
11:46
10/08/2009
Moveover jacquesh you have to follow JavaScript syntax. If a string has " and you use ans " for the string definition you should escape there: ". Better to define mystr using single quote as:
Regards
Oleg
01:42
30/09/2010
OK, I've add a cell, change the form of jsonstring ; but the problem still the same.
var mystr = '{"total": "1","page": "1","records": "1","rows" : [{"id":"1", "cell":["cell00711","cell00711","cell12","cell13","cell12","cell13"]}]}';
jQuery("#process_list")
.jqGrid("setGridParam", {datastr:mystr})
.trigger("reloadGrid");
Everything is OK via json(URL) but not with json(string)
Can you try to create a mini sample with a grid with new data when reloading with jsonstring as datatype.
I'd like to see a worked sample to be sure it's not a bug
Thanks !
Most Users Ever Online: 715
Currently Online:
46 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66