optikalefx / OpenJS-Grid

OpenJS Grid is the easiest jQuery Grid ever. With very little work you can have a data grid that can do everything from sorting and searching to complex database queries. Best of all, its open source. So you can learn how it's all done.
http://square-bracket.com/openjs
MIT License
96 stars 46 forks source link

Filter search does not display results which contain "(" and ")" brackets #55

Closed viberations closed 9 years ago

viberations commented 10 years ago

Hello and first of all thanks for the amazing product!

I've just noticed that when I use the filter function it does not display the rows which contain "(" and ")" characters in a primary key column values. I have tried adding these brackets in non-primary-key column values and it displays correctly there. Furthermore I have discovered when I just add one "(" bracket without adding the closing ")" anywhere in the text, it breaks the functionality even more - the filter returns ZERO results after I type two initial characters in the search field.

It all might sound a bit confusing, so let me explain on the example here:

  1. Column "Artist" set as primary key, varchar(255), utf8_unicode_ci in MySQL db
  2. I have three artists, say "John Lennon", "John Doe" and "Joe Cocker".
  3. When I filter using characters "Jo" in search field - I get all three results just fine.
  4. Now when I change "John Lennon" to "John (The Beatles) Lennon" - it does not return that result when I filter by "Jo" string
  5. Furthermore when I change "John Doe" to "Joh(n Doe" - it stops returning anything at all as soon as I type second letter "o" in my filter string "Jo".

I'm sure there should be a simple fix to that, but I'm just not good enough to pull it myself. Appreciate if you could help fixing it there.

Thanks!

optikalefx commented 10 years ago

Fantastic report. Thank you! I'll be on vacation for about a week. When I get back I can take a look at this.

Thanks! On Aug 26, 2014 7:07 AM, "viberations" notifications@github.com wrote:

Hello and first of all thanks for the amazing product!

I've just noticed that when I use the filter function it does not display the rows which contain "(" and ")" characters in a primary key column values. I have tried adding these brackets in non-primary-key column values and it display correctly there. Furthermore I have discovered when I just add one "(" bracket without adding the closing ")" anywhere in the text, it breaks the functionality even more - the filter returns ZERO results after I type two initial characters in the search field.

It all might sound a bit confusing, so let me explain on the example here:

  1. Column "Artist" set as primary key, varchar(255) in MySQL db
  2. I have three artists, say "John Lennon", "John Doe" and "Joe Cocker".
  3. When I filter using characters "Jo" in search field - I get all three results just fine.
  4. Now when I change "John Lennon" to "John (The Beatles) Lennon" - it does not return that result when I filter by "Jo" string
  5. Furthermore when I change "John Doe" to "Joh(n Doe" - it stops returning anything at all as soon as I type second letter "o" in my filter string "Jo".

I'm sure there should be a simple fix to that, but I'm just not good enough to pull it myself. Appreciate if you could help fixing it there.

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/optikalefx/OpenJS-Grid/issues/55.

Miqi180 commented 9 years ago

If this is a permanent problem on your site, either

a) You have a bad implementation of the OpenJS code, or b) The problem lies elsewhere

I tried to reproduce the problem on my site and the filter function works just fine by me, even with parentheses in the search string. Furthermore, there is nothing in the code that would prevent filtering strings that contain parentheses. Maybe you're using html entities for parentheses? That might explain it.

optikalefx commented 9 years ago

Ill look into this, I don't have the latest on square-bracket's site. I need to get that whole site updated. So it very well could be an old problem.

optikalefx commented 9 years ago

Closing this for now, I still need update my site, but if it works fine for you, and i haven't anyone else say something, I think it's an old version problem. Will re-open if its' not the case.