Forum

July 12th, 2025
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Having trouble binding json data to the grid.
19/08/2010
21:19
Avatar
mattdlong
New Member
Members
Forum Posts: 1
Member Since:
19/08/2010
sp_UserOfflineSmall Offline

Hi,

I'm hoping someone can help me out, I'm having some trouble binding my json data to the grid, it looks as if the correct number of rows I am expecting are being displayed in my grid, but nothing seems to be bound inside my columns.

My json data looks like this,

{"page":1,"total":1,"records":2,"rows":[{"Id":1,"Start":"7/19/2010 12:00:00 AM","End":"8/18/2010 12:00:00 AM","MediaId":"E0001"},{"Id":1,"Start":"7/19/2010 12:00:00 AM","End":"8/18/2010 12:00:00 AM","MediaId":"E0002"}]}

Which I'm trying to bind to my grid using this code,

            $("#job-list").jqGrid(
            {
                url: "Report/RetrieveJobs/" + startDate + "/" + endDate + "/" + clientId + "/" + projectId + "/" + mediaId,
                datatype: "json",
                height: 200,
                jsonReader : {
                    root: "rows",
                    page: "page",
                    total: "total",
                    records: "records",
                    cell: "",
                    id: "0"
                },
                colNames: ['Id', 'Media Id', 'Start Date', 'End Date'],
                colModel: [
                            { name: 'Id', index: 'Id', width: 55 },
                            { name: 'MediaId', index: 'MediaId', width: 90 },
                            { name: 'Start', index: 'Start', width: 100 },
                            { name: 'End', index: 'End', width: 100 }
                          ],
                sortname: 'Id',
                sortorder: "asc",
                multiselect: true,
                loadComplete: showJobList
            });

When the data is bound, the loadComplete callback is successfully being called, and like I said the correct number of rows are being displayed on the column, my only problem is that there is no data being displayed in the column cells.

If someone could give me some guidance I would really apprecaite it.

Thanks in advance,

Matt.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

Currently Online:
19 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information