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
Bug in both old and new multisearch with "not equal" operation and OR (any) grouping
19/02/2011
01:16
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony!

I answerd to the question on the stackoverflow and could confirm that the user found the bug in jqGrid. The bug in in the grid.base.js file and it take place in both old and new filter plugin which you develop now.

The problem and the solution I described in my answer. I suggest to insert the following very simple code

this.notEquals=function(f,v,t){
    return self._compareValues(self.equals,f,v,"!==",t);
};

after the code of this.equals function. In the code of  this.equals function one can by the way replace "==" to "===".

Morover one should modify the line 1359 from

'ne':function(queryObj) {return queryObj.not().equals;},

to

'ne':function(queryObj) {return queryObj.notEquals;},

It solved the problem.

Best regards
Oleg 

19/02/2011
11:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

19/02/2011
13:04
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi Tony,

It seems to me that all construction from compareFnMap where not() are used ('nc', 'bn', 'en', 'ni') work incrrect with OR ('any') operation. Try for example in "fixed" the demo for

(Client "does not end with" 'F') OR (Client "does not end with" 'O')

or (Client "does not contain" 'F') OR (Client "does not contain" 'O').

It will executed as

(Client "does not end with" 'F') AND (Client "does not end with" 'O')

or as (Client "does not contain" 'F') AND (Client "does not contain" 'O') instead.

I am not sure that the order of operators in compareFnMap correct is or probebly one have to insert call of _resetNegate() somewhere. It can be that one should modify this.orNot and this.andNot to use

this.andNot=function(f,v,x){
    _negate=!_negate;
    self._setCommand(self.and,f);
    self._resetNegate();
    return self;
};

or

this.orNot=function(f,v,x){
    _negate=!_negate;
    self._setCommand(self.or,f);
    self._resetNegate();
    return self;
};

instead of current implementations. If can be that this.isNot function has the same problem with resetting of _negate. I don't tested all carefully enough.

What will be definetively work is including additional notContains, notStartsWith, notEndsWith functions like I made with notEquals.

Best regards
Oleg

19/02/2011
14:03
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Oleg,

The problem is that not() executes andNot(), without to care of the !== operator. i.e orNot()  .. hum - will see how to fix.

Tahnks

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

19/02/2011
14:20
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi Tony,

I suppose that the code try to change the expretion like

NOT(X OR (Y AND Z))

to

((NOT X) AND NOT(Y AND Z))

or to

((NOT X) AND ((NOT Y) OR (NOT Z)))

which would be correct, but the implementation is buggy and the usage of NOT inside a block change OR to AND outside of the block.

Oleg

19/02/2011
14:22
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

19/02/2011
16:12
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Currently the loading from the GitHub not work, so I will test the suggestion later, but it seems to me that the fix is the real solution of the problem.

Best regards
Oleg

19/02/2011
20:52
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

I could test the last changed in grid.base.js. Everything seems be fixed now.

On the other side the code of grid.filter.js has some small problems with selects build from dataUrl. If the select has no option with selected="selected" attribute the old plugin jquery.searchFilter.js shown just the first option as selected.

Try with the old style demo and the new filter demo. The old plugin worked without any problem with selects.

The new plugin looks different in FF and IE. In FF one see

Image Enlarger

and on IE and Chrome:

Image Enlarger

but after the click on the select box:

Image Enlarger

Moreover in many places of the code of grid.common.js one find code like

this.selected = ""

or

this.selected= "selected";

or

ov.selected ="selected";

where this or ov are DOM elements of the <option>. The selected property of the DOM element is boolean and readonly (see here for example) and not string. One should probably work with selectedIndex of parent <select> element.

In the example above one should probably set selectedIndex to 0 if it has -1 value after the initialization from dataUrl.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
40 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