Forum



18:51

09/12/2011

Hello,
I'm having an issue with parsing a JSON string that contains an array:
What I would like to have displayed in JQgrid is something like:{"max":20,"total":1,"rows":[{"line":"THIRD_LINE","cell":123456789,"aptitudeHashSet":[{"skillName":"Swimming" ,"value":1,"id":3,"color":"RED"},{"skillName":"Shotput","value":5,"id":1,"color":"WHITE"},{"skillName" :"Track","value":5,"id":2,"color":"GREEN"}],"name":"jon smith","id":1,"region":"The end","available" :true}],"page":1}
name | region | cell | line | SWIMMING ('skillName') | swimmingColor | ~~next skill etc |
---|---|---|---|---|---|---|
Jon Smith | The end | 123456789 | FIRST_LINE | 1 ('value') | RED | ~~next skill etc |
In our DB we have a persons table that references a skills table with a list of skills.
Is this possible or do I need to generate a customized JSON string from the server?
Thanks,
bpcm
11:01

Moderators
30/10/2007

Hello,
You will need to configure your JSON reader. Reading docs us usefull thing.
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.
18:07

09/12/2011

tony said:
Hello,
You will need to configure your JSON reader. Reading docs us usefull thing.
http://www.trirand.com/jqgridw.....#json_data
Regards
Hello,
I can seem to display data in the table using 'dot notation' but when I edit a 'person', jqGrid returns:
I think the problem is that I have unnamed arrays within an array; jqGrid ignores them
It does not return an array of skills.I would like it to return:
I think it needs to match format of servers JSON:
name:'name',
width:300,
editable:true,
editrules:{required:true}
},{ width:52,
editable:true,
jsonmap:"aptitudeHashSet.1.value"
}...];
root:"rows",
repeatitems:false}
Somehow I have configured jqgrid incorrectly. It seems the colmodel flattens out the arrays.
Thank you, bpcm
Most Users Ever Online: 715
Currently Online:
182 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