Forum
17:28
03/02/2010
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.
18:55
03/02/2010
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.
Most Users Ever Online: 715
Currently Online:
59 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