Forum
12:25
04/10/2011
Hi there,
I encountered an unexpected behaviour when using the jqGrid 4.1.2 filtertoolbar with colModel definitions that contained a custom set of searchoptions (sopt). The filtertoolbar search is always using the first of the defined custom searchoptions, disregarding the defaultSearch value set for the filtertoolbar.
Sample colModel definition:
colModel: [ name: 'Name', index: 'Name', searchoptions: { sopt: ['eq', 'ne', 'bw', 'cn'], } ]
With this colModel, the search is always using the operator "eq".
I was expecting following behaviour: if the custom searchoptions contains the defaultSearch value specified by the filtertoolbar, use the default; otherwise use the first of the custom searchoptions.
Following change fixes the problem (jqGrid 4.1.2, Line 3473):
so = (this.searchoptions && this.searchoptions.sopt && (!p.defaultSearch || $.inArray(p.defaultSearch, this.searchoptions.sopt) == -1)) ? this.searchoptions.sopt[0] : p.defaultSearch;
regards,
Tobias
13:24
10/08/2009
It's important feature and not a bug. The defaultSearch option of filterToolbar method set default options for all columns. It makes problems. Let us you have colum with select having "equal" and "not equal" option. If you would use defaultSearch:'cn' option the row having either "equal" or "not equal" would be filtered because "not equal" contains "equal". To solve the problem one should include searchoption having 'eq' on the first place.
It is not the only example where one need specify the operation used for specified column intead of defaultSearch option of filterToolbar method used as the default searching operation for all other columns.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
52 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