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

Bug: Search tries to change numbers to lowercase #37

Closed funkytaco closed 11 years ago

funkytaco commented 11 years ago

Line 912 of grid.js tries to change numbers to lowercase var string = row[key].toLowerCase(); To reproduce, try to filter the grid with a number.

Even with the bug, filtering still works.

optikalefx commented 11 years ago

What bug does this cause? The numbers are just strings "45", and "45".toLowerCase() results in "45"

funkytaco commented 11 years ago

I should have said you're not catching the TypeError.

Uncaught TypeError: Object 1 has no method 'toLowerCase' grid.js:912

window.Grid.Root.jQueryPlugin.filter grid.js:912 (anonymous function)

optikalefx commented 11 years ago

Hmmm and how were you able to get that to come up? I can search numbers on my site without that coming up.

Thanks! On Oct 24, 2013 2:04 PM, "funkytaco" notifications@github.com wrote:

I should have said you're not catching the TypeError.

Uncaught TypeError: Object 1 has no method 'toLowerCase' grid.js:912

window.Grid.Root.jQueryPlugin.filter grid.js:912 (anonymous function)

— Reply to this email directly or view it on GitHubhttps://github.com/optikalefx/OpenJS-Grid/issues/37#issuecomment-27015457 .

funkytaco commented 11 years ago

I was able to duplicate the error.

This happens when the JSON data is not a string.

i.e. somejsondata: 1 as opposed to: somejsondata: "1"

But, I just remembered I'm using a raw json file and not your ajax.php and grid.php files. Oops.

optikalefx commented 11 years ago

Ah, that'll do it. I need to make updates to allow for a JSON loaded object.