Forum
19:42
18/03/2011
I have defined a datagrid in the following way:
$("#grid").jqGrid(
{
height: 400,
autowidth: true,
datatype: 'local',
altRows: true,
colNames:
[
'col 1',
'col 2',
'col 3',
'col 4',
'col 5'
],
colModel:
[
{ name: 'col1', index: 'col1'},
{ name: 'col2', index: 'col2' },
{ name: 'col3', index: 'col3'},
{ name: 'col4', index: 'col4', formatter: cellFormatter},
{ name: 'col5', index: 'col5', formatter: cellFormatter }
],
rowNum: gridData.rows.length,
viewrecords: true,
recordtext: "{2} Results",
sortname: 'col1',
sortorder: "ASC",
caption: "caption",
pager: '#pager',
pgbuttons: false,
pginput: false
});
$("#grid")[0].addJSONData(gridData);
the idea is that i want to send the data down from the server as gridData with the original request.
when the above code runs, it generates blank rows for each record, the ones with cell formatters will input undefined.
I do not want to use array data because i do not want generically assigned id'. I need to minipulate the data base on outside criteria so i need non generic id's.
if i change the datatype to json, it does an ajax request for the data after the page loads which is unnecessary for this particular grid.
if i change the datatype to function(postData){}, it works and makes no request, however the sorting then no longer works.
Most Users Ever Online: 715
Currently Online:
39 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