Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get data for all rows in jqgrid with pagination

Tags:

jquery

jqgrid

I want to access grid data as below

    var namePresent;
    var datafromgrid = $('#MyGrid').jqGrid('getRowData');
    for (var i = 0; i < rowCount; i++) {
         var name = datafromgrid[i].Name;
         var firstname = name.split(/ +/);
         if (firstname[0].toLowerCase() == Name.toLowerCase()) {
             namePresent = 1;
         }
    }

Now suppose when my grid is loaded with 5 records then this code throws error on line var name = griddata[i].Name; as from grid it is unable to read griddata[5]. Please tell me how to read whole grid data even if it is not visible on screen but is fetched successfully?

like image 435
mailmehere Avatar asked Oct 31 '13 09:10

mailmehere


People also ask

How can I select multiple rows in jqGrid?

Show activity on this post. var myGrid = $('#task-grid'), selRowId = myGrid. jqGrid ('getGridParam', 'selrow'), celValue = myGrid. jqGrid ('getCell', selRowId, 'HOURS');

How do I get the value of a jqGrid cell?

How to get a cell value in JQGrid? var ret = jQuery("#MyGrid"). jqGrid('getRowData', id); ret = ret.

What is rowNum in jqGrid?

jqGrid exposes a property rowNum where you can set the number of rows to display for each page.

How is jqGrid width dynamically set?

You can set the new width of the column using two methods – setColProp and setGridWidth. This solution works, except that I needed to use "widthOrg" instead of "width" in the call to 'setColProp'.


1 Answers

you can try using :

var allRowsInGrid = $('#list4').jqGrid('getGridParam','data');
like image 110
checkgdata Avatar answered Sep 28 '22 06:09

checkgdata