Forum
12:12
07/07/2010
Hi,
Hopefully this is a quick one!
I have an editable grid using 'clientSide' (local) data and I now wish to iterate all the rows in javascript and process/package the data myself before sending it to the server via a jQuery.ajax call.
The problem is that, unexpectedly (for me at least), using the following code only retrieves the rows for the currently visible grid page! How can I get ALL the rows in the grid (i.e. I have four pages of 10 records each and this code only returns the first 10 when I'm on page 1)? They must be present in the client somewhere because I can page around and edit the rows and the data is persisted without calling the server!
cacheCONF = [];
var rows= $('#myGrid').getRowData(); //<–Need to get ALL rows here!!!
var cacheRowID = 0;
for (var row in rows) {
if (rows[row].Action == 'Yes') {
cacheCONF.push({ RowID: rowID, System: rows[row].System, Action: rows[row].Action, Account: '-', Required: '-' });
rowID++;
}
}
Thanks!
12:47
07/07/2010
Found a workaround by temporarily changing the page size. Hope there's a more "formal" solution.
Code is:
var pageSize = $('#myGrid').getGridParam('rowNum');
$('#myGrid').setGridParam({ rowNum: 10000 }).trigger("reloadGrid");
getRowData will then get up to 10000 rows (so set it higher than your max possible rows).
You can then use pageSize to set the page size back to the user's preference.
15:21
Moderators
30/10/2007
Hello,
If you are in local mode it is just simple
var mydata = $("#grid").jqGrid('getGridParam','data');
will give you all your data.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
11:37
27/05/2011
That was fast OlegK, thanks but I've found the solution at http://stackoverflow.com/quest.....-same-time
Most Users Ever Online: 715
Currently Online:
50 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