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_TopicIcon
filtertoolbar with custom colModel searchoptions.sopt
04/10/2011
12:25
Avatar
corux
New Member
Members
Forum Posts: 1
Member Since:
04/10/2011
sp_UserOfflineSmall Offline

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

02/01/2012
10:36
Avatar
ChrisXa
Member
Members
Forum Posts: 5
Member Since:
02/01/2012
sp_UserOfflineSmall Offline

Bug still exists in 4.3.1.

02/01/2012
13:24
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

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 

03/01/2012
13:06
Avatar
ChrisXa
Member
Members
Forum Posts: 5
Member Since:
02/01/2012
sp_UserOfflineSmall Offline

I still think it's a bug. Of course, there should be a separate way to set search options for the filter toolbar. But as long as this is not possible, I expect the filter toolbar (just as I expect any other search input) to use the default search options.

Forum Timezone: Europe/Sofia

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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information