0

I was looking to fetch the client side filtered data from the jqgrid. I saw this Get all rows not filtered from jqGrid post and tried Oleg's solution. But i am getting an Undefined error for 'lastSelected' parameter. I am using jqGrid 4.8.2 and jQuery 1.10.2. It looks in this version the lastSelected parameter has been renamed or removed. I have to use these versions because of some other code dependencies. Can anyone suggest me a solution?

Thanks in advance

Community
  • 1
  • 1
Neelima
  • 83
  • 2
  • 7

1 Answers1

0

Short time after publishing of jqGrid 4.7 at Dec 8, 2014 Tony Tomov have changed license agreement (see jqGrid 4.7 published at Dec 16, 2014). Because of that I started so continue to develop my own fork of jqGrid based on jqGrid 4.7 (the last version available under MIT/GPLv2 licenses) under the name free jqGrid. You can download it from github. More information about it is available in readme and in wiki.

So there are exist now Guriddo jqGrid JS which can be purchase here. So the full name of jqGrid 4.8.2 is Guriddo jqGrid JS 4.8.2.

The answer which you referenced shows how to "subclass" internal jqGrid method $.jgrid.from to have access to new custom "lastSelected" parameter. The technique is tricky, but it works with old versions of jqGrid.

If you would use free jqGrid 4.8 or later then you can just use new lastSelectedData option, which have the same meaning like "lastSelected" parameter in my old answer. At the end of readme you will find some demos. The first demo is what you need.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Thanks you so much for the response @Oleg . I tried the solution. Now i don't get the undefined error but still i cannot get the job done. When i debug i see the the 'filteredData' parameter is returning null. I am using the data from server and load once is set to true. So like you suggested in the thread i used '_id_ ' instead of id but i still cannot get the result. Also i have subgrids in my grid. Unfortunately I cannot post my code here, because it says it is too long. Is there a way i can send you the code? – Neelima Apr 27 '15 at 13:49
  • @Neelima: Please reread my answer. The name of parameter is `lastSelectedData` and not `filteredData`. You can open [the demo](http://www.ok-soft-gmbh.com/jqGrid/OK/GetFilteredData.htm), click on right mouse button to open context menu and choose "Souce Code" to view the code of the demo. You will see that I use `var filteredData = $grid.jqGrid("getGridParam", "lastSelectedData");`. If you use [the demo](http://www.ok-soft-gmbh.com/jqGrid/GetFilteredData.htm) for old jqGrid and subclass `$.jgrid.from` then the name of the parameter: `lastSelected` (not `filteredData`). – Oleg May 07 '15 at 15:56
  • @Neelima: If you open [my profile](http://stackoverflow.com/users/315935/oleg?tab=profile) on the stackoverflow you fill find my email: oleg.kiriljuk@ok-soft-gmbh.com – Oleg May 07 '15 at 15:58