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?
Show activity on this post. var myGrid = $('#task-grid'), selRowId = myGrid. jqGrid ('getGridParam', 'selrow'), celValue = myGrid. jqGrid ('getCell', selRowId, 'HOURS');
How to get a cell value in JQGrid? var ret = jQuery("#MyGrid"). jqGrid('getRowData', id); ret = ret.
jqGrid exposes a property rowNum where you can set the number of rows to display for each page.
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'.
you can try using :
var allRowsInGrid = $('#list4').jqGrid('getGridParam','data');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With