Is there any method I can get the full JSON
data from jqGrid when datatype is local along with the column name?
In this format: [{"firstname": "Chris"},{"firstname": "Dave"}]
Is there any method I can get the full JSON
data from jqGrid when datatype is local along with the column name?
In this format: [{"firstname": "Chris"},{"firstname": "Dave"}]
You can use the getRowData
method to return an array containing all of the grid data. For example:
var fullData = jQuery("#myGrid").jqGrid('getRowData');
Here is the documentation for getRowData
from the jqGrid wiki, which helps explain what is going on:
getRowData
Parameters: rowid or noneReturns: array
Description:
Returns an array with data of the requested id = rowid. The returned array is of type name:value, where the name is a name from colModel and the value from the associated column in that row. It returns an empty array if the rowid can not be found.
If the rowid is not set the method return all the data from the grid in array
You might also be interested in the data
parameter, which can be used to retrieve the data passed to the grid. From the jqGrid docs:
An array that stores the local data passed to the grid. You can directly point to this variable in case you want to load an array data. It can replace the addRowData method which is slow on relative big data
var data = $('#' + gridid).jqGrid('getGridParam', 'data');
Does that help?
© 2022 - 2024 — McMap. All rights reserved.