Forum


21:52

01/09/2010

I'm having a problem with selecting the correct row when scroll:1 (virtual scrolling). After loading the next page (after the first) of data the row id goes back to 1 and the .getCell method returns the first page data. For example clicking on record number 26 will return the rowid of 1 and the getCell name of the first record. Trying to find a cell value of rowid = 26 returns FALSE.
jQuery('#tblTest').jqGrid({
url: 'data.php',
datatype: 'json',
mtype: 'GET',
colNames: ['ID', 'Name', 'Phone Number'],
colModel: [
{ name: 'ID', index: 'intID', sorttype: 'int', hidden: true, hidedlg: true },
{ name: 'Name', index: 'strFirstName', width: 100 },
{ name: 'Phone', index: 'strPhone' },
],
scroll: 1,
pager: '#divTestPager',
rowNum: 25,
viewrecords: true,
recordtext: '{2} Record(s) Total',
onSelectRow: function(rowid) {
var clkid = jQuery("#tblTest").getCell(rowid, "Name");
alert('rowid: ' + rowid + ' Name: ' + clkid);
}
});
16:31

10/08/2009

Try to include key: true in the declaration of the 'ID' column.
Best regards
Oleg
16:40

01/09/2010

OlegK said:
Try to include key: true in the declaration of the 'ID' column.
Best regards
Oleg
That seems to have done the trick. Thank you very much!
Most Users Ever Online: 715
Currently Online:
57 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