Forum


03:38

04/09/2009

Hello Guys,
I have added the grid code:
[code]
jQuery(document).ready(function() {
jQuery("#list").jqGrid({
url: '<?=base_url()?>submits/submitslistpage/getdata',
datatype: "json",
mtype: 'POST',
colNames: ['<{th_form_name}>', '<{lbl_date_sub}>', '<{lbl_ip_sub}>', '<{th_action}>'],
colModel: [
{name: 'form_name', index: 'form_name', width: 100, edittable: true},
{name: 'submit_created', index: 'submit_created', width: 50, edittable: true, align: "center"},
{name: 'submit_ip', index: 'submit_ip', width: 50, edittable: true, align: "center"},
{name: 'action', index: 'action', width: 50, edittable: true, align: "center"}
],
rowNum: 20,
rowList: [10, 20, 30],
imgpath: gridimgpath,
pager: jQuery('#pager'),
sortname: 'submit_created',
sortorder: "desc",
width: "800",
height: "100",
viewrecords: true,
multiselect: true,
caption: "Submits"
}).navGrid('#pager',{edit:false,add:false,del:true}
);
});
[/code]
Then I am returning following json data from server:
{"page":1,"total":1,"records":"1","rows":
[{"id":"f76d76cb2c","cell":["f76d76cb2c","2009-08-31 07:44:17","85.90.206.124","form_next","action"]}]}
The error I am getting is:
[code]cm is undefined
anonymous(Object 0=td length=1 context=td jquery=1.3.1, tr#f76d76cb2c, "action", 5, "add") grid.base.js (line 703)anonymous(Object page=1 total=1 records=1 rows=[1], div.grid_bdiv, Object name=rcnt value=0) grid.base.js (line 835)L() jquery.js (line 19)[/code]
The grid shows up with columns, but then it displays “Loding..” indefinitely and throws above error.
Thanks for your time.
04:56

Moderators
30/10/2007

Hello,
You have 5 items in the response - see cell array, but you define 4 in colModel
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.
Most Users Ever Online: 715
Currently Online:
49 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