Forum
14:02
Hello,
Sorry for the cross-post, but I was wondering if this is a bug or unsupported feature.
http://www.trirand.com/blog/?p.....lse/#p9189
Kien Nguyen said:
Hello,
I was wondering how to get JSON SubGrid with repeatitems:false working. The demo shows an example with repeatitems:true and I've got this working, however, for repeatitems:false to work I assume it needs column index names supplied somehow (as opposed to the label names supplied by “subGridModel: [{name:[]}]” as per the demo. Can this be done? Thank you.
I have tried the following methods that do not appear to work:
subGridModel: [
{name:'id',index:'id',label:'ID', width:100},
{name:'name',index:'name',label:'Name',width:100}
]subGridModel: [
{name:['id','name'], index:['id','name'], width:[100,100], align:['left','left'], params:['id']}
]
02:50
Moderators
30/10/2007
Hello,
where you set repeatitems. Look at the docs. Maybe you need:
jsonReader :{
...
subgrid : {repeatitems: false}
}
I.e this shoul be set in subgrid object.
Best 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.
12:16
Hello, my jsonReader code is currently as follows, which doesn't seem to work.
{jsonReader: {repeatitems:false, subgrid: {repeatitems:false} }
Also, this is the json data being returned by the subgrid expansion call as per FireBug. This seems to follow the default format as noted in the wiki.
{"rows":[{"id":5,"name":"HWS"},{"id":7,"name":"CRC"}]}
The subgrid does open with the correct columns (id and name) and the browser is requesting and receiving the json data above, but jqGrid is not loading this data into the subgrid. Thanks for helping.
13:09
Moderators
30/10/2007
Hello,
The problem:
1. There was a missed documentation on how to use this - sorry.
You should add a mapping property like this
subGridModel: [
{name:['id','name'], index:['id','name'], mapping:['id','name'], width:[100,100], align:['left','left'], params:['id']}
]
2. I have corrected this behaviour - i.e if the mapping is not defined a name property is used.
Thanks
Best 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.
11:54
Sorry to ressurcet this thread, but I have exactly the same problem.
I'm using v.3.5.3. Here are portions of the jqGrid declaration:
jsonReader: {
repeatitems: false,
id: “ID”,
subgrid: {
repeatitems: false,
id: “ID”
}
},
subGridModel: [
{ name: ['ID', 'RowPrice', 'Status', 'DiscountFlatOff', 'DiscountPercentOff'],
index: ['ID', 'RowPrice', 'Status', 'DiscountFlatOff', 'DiscountPercentOff'],
width: [60, 60, 60, 60, 60],
mapping: ['ID', 'RowPrice', 'Status', 'DiscountFlatOff', 'DiscountPercentOff']}]
The returned json data looks like this (via FireBug):
{"rows":[{"ID":1,"RowPrice":"1","Status":"Current","DiscountFlatOff":"0","DiscountPercentOff":"0"}]}
I believe this is valid format.
I have done everything as described, but still the subgrid is empty.
To summarize the problem: The subgrid does open with the correct columns (id and name) and the browser is requesting and receiving the json data above, but jqGrid is not loading this data into the subgrid.
thx
Stephan
08:22
Moderators
30/10/2007
Hello,
There is no need to set the id in the subgrid reader.
The JSON string IMHO is correct
Only the mapping can make some problems.
Please try withourt mapping option and let me know if this work.
I will check this option in the meantime.
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.
Most Users Ever Online: 715
Currently Online:
68 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