I want to know whether there is any method to get all jqGrid data of visible columns irrespective of paging.
$("#listTableSupply").jqGrid("getGridParam", "data");
But it shows all json data which I have passed to jqgrid. As I use paging in jqgrid if I use
$('#list').jqGrid('getRowData');
I get only the records from 1st Page.
I need to know is there any way that I have to get all data with visible columns irrespective of paging.
The usage of
getGridParam
withdata
is the correct way. If you need to remove some properties from the item or the array then you should make deep copy of the array (by usage of$.extend(true, {}, data)
) and remove unneeded properties from every item of the array.Alternatively you can copy all properties with non-hidden columns in new array. The code could be about the following:
I don't tested the above code, but I hope it fill
newData
array with the data, which you need.UPDATED: I created the demo for you, which demonstrates the usage of
lastSelectedData
instead ofdata
. It fills in the resulting arraynewData
the filtered items of the grid, including only visible columns. You can filter the data and then click on the button "Show non-hidden fields of filtered and sorted data". The demo fills thenewData
array and display it. I used the following code inside ofclick
handler: