Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
json local search bug
01/04/2011
16:07
Avatar
brg07003
New Member
Members
Forum Posts: 2
Member Since:
05/01/2011
sp_UserOfflineSmall Offline

Currently, when you load data using the addJsonData method and the datatype is 'json' and you try local searching, all of the rows simply go away, instead of properly filtering the grid. By changing the datatype to 'jsonstring', the problem goes away and the local searching performs as expected (no change is needed to the incoming data).

Steps to Reproduce:

Create a grid with datatype: 'json' and do the following:

1) Load data to the grid using the addJSONData method.

2)Perform local search. This is how I am currently doing it:

   var grid = $('testGrid');

   var postdata = grid.jqGrid('getGridParam', 'postData');

   $.extend(postdata,

     {

filters: '',

searchField: 'colname'

searchOper: 'eq'

searchString: 'test'

     });

     grid.jqGrid('setGridParam', {search: true, postData: postdata });

     grid.trigger('reloadGrid', [{page: 1}]);

3) You will notice that the rows disappear instead of being filtered. Now change the grid's datatype to 'jsonstring' and try again. You will notice that the rows are properly filtered.

I have found the bug in the grid.base.js file in version 3.8.2 at line 1167:

locdata = (ts.p.datatype != "local" && ts.p.loadonce) || ts.p.datatype == "jsonstring";

Changing the line to the following causes it to work with datatype 'json'

locdata = (ts.p.datatype != "local" && ts.p.loadonce) || ts.p.datatype == "jsonstring" || ts.p.datatype == "json";

jqGrid version: 3.8.2

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
61 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information