Forum

November 2nd, 2014
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_TopicIcon
Get correct row data with virtual scrolling
01/09/2010
21:52
Avatar
Jazar
Member
Members
Forum Posts: 9
Member Since:
01/09/2010
sp_UserOfflineSmall Offline

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);

}

});

07/09/2010
15:03
Avatar
Jazar
Member
Members
Forum Posts: 9
Member Since:
01/09/2010
sp_UserOfflineSmall Offline

Has anyone been able to get the correct Cell data when using virtual scrolling (after the first page)? Please help.

Thank you.

07/09/2010
16:31
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Try to include key: true in the declaration of the 'ID' column.

Best regards
Oleg

07/09/2010
16:40
Avatar
Jazar
Member
Members
Forum Posts: 9
Member Since:
01/09/2010
sp_UserOfflineSmall Offline

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!

20/01/2011
01:02
Avatar
JustinNoel
New Member
Members
Forum Posts: 1
Member Since:
20/01/2011
sp_UserOfflineSmall Offline

Thank you so much for posting this question and the answer.  I was having this same problem when trying to use the onSelectRow event.  Setting 'key:true' in the colmodel did the trick.

Forum Timezone: Europe/Sofia

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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information