Forum


11:59

Hi....
Is it possible to directly use JSON data returned from the server in the following format:
{ "reportObject" : { "columnNames" : [ "from__campaign_name",
"to__campaign_name",
"transfer_count"
],
"columnTypes" : [ "VARCHAR",
"VARCHAR",
"BIGINT"
],
"createTimeStamp" : "2009-10-21 17:42:58",
"results" : [ [ "Basic_EN_AfterHours",
"",
"34"
],
[ "Basic_EN_CaseLU",
"",
"28"
],
[ "Basic_EN_CaseLU",
"Basic_EN_Greeting",
"82"
],
[ "Basic_EN_CaseLU",
"B_Other",
"55"
],
The "results" element contains all of the data for the table cells.
Thanks,
Dave
23:10

Thanks, John...
I'm still having trouble with this, though. The example shows data arranged in an array of unnamed objects, not an array of arrays.
I tried setting cell:"" in the jsonReader, but it's still not getting the data to display. What should I have for the colModel ? This is what I have so far:
colModel :[
{name:'from_campaign_name', width:300},
{name:'to_campaign_name', width:300},
{name:'transfer_count', width:100}
],
pager: jQuery('#pager'),
rowNum:10,
rowList:[10,20,30],
sortname: '',
sortorder: "",
viewrecords: true,
imgpath: 'themes/basic/images',
caption: 'My first grid',
jsonReader : {
root: "results",
page: "",
total: "",
records: "",
repeatitems: true,
cell: ""
}
I get the table header and footer, but no data.
Thanks,
Dave
03:04

Moderators
30/10/2007

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:
67 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