Forum


17:36

29/11/2010

Hi All,
I am new to jqGrid, it looks great thanks. I am trying to load local data into a grid and it works fine unitl I put the pager option on.
When I add the pager option my grid is rendered empty with the text "undefined" in the center if the grid.
Here is the javascript for my test:
jQuery("#queueTable").jqGrid({
datatype: "clientside",
autowidth: true,
colNames: ['Name', 'Type', 'Desc'],
colModel: [
{name:'name', index:'name'},
{name:'type', index:'type'},
{name:'desc', index:'desc'}
],
altRows: true,
caption: ""
});
var mydata = [
{name:"Test", type:"type1",desc:"Desc1"},
{name:"Test1", type:"type2",desc:"Desc2"}
];
for (var i = 0; i < mydata.length; ++i) {
jQuery("#queueTable").jqGrid('addRowData', i+1, mydata[i]);
}
Below is my html:
<table id="queueTable"></table>
<div id="queuePager"></div>
The above works fine, but when I add
pager: "#queuePager"
to the jqGrid constructor I get the grid with the column headers but no data. There is a white box with an orange border which says 'undefined' in orange.
I assume I am missing some configuration option but I can't seem to figure it out.
Thanks
Glenn
00:03

10/08/2009

Hello Glen,
probably you included not all jqGrid modules which you needed. Look at the code here which shows how I would do what you need.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
35 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