Forum
16:07
05/01/2011
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
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66