Forum


17:38

06/03/2010

Hi,
I would like to populate a grid with json data, but i don't have control over the json format, after reading the wiki it seems that i need some items in the data like num of records and so even if i use jsonReader, but the format i have is:
I've not been able to populate the grid, i can convert the data to array and use it but i'll loose paging functionality, the same happends if i use json string.
Anybdoy knows if i can use that data's fromat with jqgrid? An if so How?
Thanks in advance, Raúl
19:49

Moderators
30/10/2007

Hello,
Could you please post the entrie grid configuration including jsonReader
Regards
Tony
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.
00:07

06/03/2010

Hi tony,
First of all thanks for your answer.
My apologies, i've just find that maybe is not a data format problem but a connection problem, if i donwload the json file the data is displayed correctly using:
$(function(){
grid=$("#tabla").jqGrid({
datatype:'jsonp',
url:'./persona.json',
jsonReader : {
root: "personae",
page: "",
total: "",
id:'id',
repeatitems: false,
cell:""
},
colNames:['Identificador','Version','Nombre','Apellidos','Edad'],
colModel :[
{name:'id', index:'id', width:155},
{name:'version', index:'version', width:155},
{name:'nombre', index:'nombre', width:155},
{name:'apellidos', index:'apellidos', width:155},
{name:'edad', index:'edad', width:155}
],
pager: '#paginador',
rowNum:10,
rowList:[10,20,30],
sortname: 'Nombre',
sortorder: 'desc',
viewrecords: true,
caption: 'Mi primer grid'
});
Problems arise when i tried the following urls 192.168.1.7:8080/Rest1/persona.json or http://192.168.1.7:8080/Rest1/.....rsona.json, but that is another history and i 've a lot of documentation to read.
Thanks a lot for your help.
Regards, Raúl
Most Users Ever Online: 715
Currently Online:
43 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