Forum

May 22nd, 2014
A A A

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

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

Topic RSS
jqGrid Filter module rewrite
15/02/2011
13:47
admin
Admin
Forum Posts: 61
Member Since:
05/05/2007
Offline

Hello all,
After many requests and of course the problems which causes current search module we have made a decision to rewrite them.
This actually is not standard task, because all existing features should be saved.
I can not guarantee that 100% of the existing features will be available, but we will do our best to save them
Three more important thing are the goal of this rewrite:

  1. We do not more will use jQuery clone function to create new row (the most important) , but after every change the filter will be recreated using the functions from common grid module
  2. Again with the available standard search like by example:
    …WHERE a=1 AND b=2
    now we can do more complex where clauses like this
    … WHERE ( (a=1 AND b=2) or c=3)
    This mean more than one group operator can be used.
  3. Implementing a checking modules for the data input in the filter

We have placed the code in GitHub.
https://github.com/tonytomov/jqGrid/commit/0002a389ffbeab00e536c02ecade03c72ba2a6e6

Any comments, recommendations, fixes are welcome during the development of this plugin.
Note that it can be used separately.

Kind Regards
Tony

16/02/2011
13:04
OlegK
Germany
Member
Forum Posts: 1229
Member Since:
10/08/2009
Offline

It is very good new, Tony!

To help you to improve the new code I used JSlint and found following small errors or suggestions:

line 67 ended with ',' before ']' in the next line. One should remove the ','

in line 145,154,296,462,493,519,523,527,531,534 one should replace ',' with ';' at the end of line.

in line 309 will be defined unused variables o and df.

In line 516 the code '+ ""' (at the end of line) should be removed

in lines 82,119,164,184,354,377 one should add ';' at the end of lines

in line 219,354,433,468,490,492,511-514,516,517,545,547,557,559,568,570,626 insert {}

in lines 32,166,183,197,218,232,255,282,327,338,344,370,395,410,415,449,489,498,505,511-514,516,544,556,567,576 replace "==" to "==="
in lines 249,269,287,466,477,481,541,553 replace "!=" to "!=="

if would be better to move this.getStringForGroup from the line 464 after the line 494 where
the function this.getStringForRule will be defined because in lines 472,482
the function this.getStringForRule will be used inside of this.getStringForGroup

In the same way the function getStringForRule defined in the line 572 will be better to move before the line 538
where the function getStringForGroup defined which use it

I used the code loaded today so I hope the line numbers stay unchanged in your code.

I next days I want to look the new module more carefully and to test it.

Best regards
Oleg

16/02/2011
16:40
tony
Sofia, Bulgaria
Moderator
Forum Posts: 7613
Member Since:
30/10/2007
Offline

Thank you Oleg.

The most of corrections are implemented.

Will do the rest later.

Now we are on the final lap for the alfa.

Other modules will be changed at once.

I love the new module (I have a little problems with the local searching, but have already solution)

Thanks again

Tony

For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site - trirand.net - by the very same guys that created jqGrid.
18/02/2011
14:02
tony
Sofia, Bulgaria
Moderator
Forum Posts: 7613
Member Since:
30/10/2007
Offline

Hello,

If someone is interested on the new search filter a simple demo can be downloaded from this link

SearchDemo

Kind Regards

Tony

For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site - trirand.net - by the very same guys that created jqGrid.
23/02/2011
05:39
myearwood
Canada
New Member
Forum Posts: 1
Member Since:
23/02/2011
Offline

H Tony

Very good so far!

I haven't looked at the resulting where clause, but I hope you know to parameterize the user values and not concatenate them into a query string. That leads to SQL Injection and no amount of escaping the user-entered values is foolproof.

In the demo, I think there should be and/or drop down after each condition. I'd like to see the filter represented in a grid with a vertical scrollbar as well as the results grid with a vertical scrollbar.

Mike

25/02/2011
19:56
OlegK
Germany
Member
Forum Posts: 1229
Member Since:
10/08/2009
Offline

Hi Tony!

Just one idea. It would be nice to implement some kind of "filter collection": the list of some predefined filters with the name and description which could be easy loaded or saved (first in the internal parameter of jqGrid, next in qookie and which can be easy exported).

Having the possibility to define a complex query in a nice feature (what one has in the new filter module), but it could be too complex for standard users. The usage of predefined "filter collection" could simplify the work and improve users satisfaction. One could allow to switch from "standard mode" of choosing only predefined queries to "advanced mode" where full posibilities of the new filter module could be used.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 215

Currently Online:
72 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1229

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11260

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10471

Posts: 30967

Newest Members: JAZR, jterlouw951, stevetriand, Kalyan, hex, sarah-dev

Moderators: tony (7613), Rumen[Trirand] (81)

Administrators: admin (61)

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information