tags:

views:

31

answers:

1

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!

A: 

Solution from Tony: var mydata = $("#grid").jqGrid('getGridParam','data');

jqwha