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
to get the rowid of the nth row of the grid
25/02/2010
17:28
Avatar
Meng Hai
Member
Members
Forum Posts: 17
Member Since:
03/02/2010
sp_UserOfflineSmall Offline

Hi, I want to be able to read all the contents in the cells - by means of looping.

I am able to get the total columns and total row of records in the grid.

I can do so using $('#gridmain').jqGrid('getCell', rowid, column no);

but the row id is not a serial number, it is an id pulled from a table.

I know that if a row is selected I can use: jQuery("#gridmain").jqGrid('getGridParam','selrow');

But what if a row is not selected and I want the rowid of the 3rd or 5th row of the grid?

Is there a method or function to get the rowid of the nth row so that i can apply $('#gridmain').jqGrid('getCell', rowid, column no); to get the content of the cell?

Thanks.

25/02/2010
18:55
Avatar
Meng Hai
Member
Members
Forum Posts: 17
Member Since:
03/02/2010
sp_UserOfflineSmall Offline

Found the answer using $('#gridmain').jqGrid('getDataIDs');

It will return an array of ids for the visible grid.

So to get the nth rowid, i use:

var rids = $('#gridmain').jqGrid('getDataIDs');

var nth_row_id = rids[n-1]; //bec the row array starts from zero.

Hope it will help others, if interested.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
52 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