Need of insensitive case filter

257 views
Skip to first unread message

neoswf

unread,
May 29, 2012, 3:35:16 PM5/29/12
to slic...@googlegroups.com
Hi.
Is there's a way to change the filter from case sensitive to insensitive?

Thank you.
Message has been deleted

Jeremy

unread,
May 29, 2012, 9:07:29 PM5/29/12
to SlickGrid
Not a SlickGrid question, technically, but...

Assuming we're starting with something like the filtering example:

http://mleibman.github.com/SlickGrid/examples/example4-model.html

you'll have a function that does the actual filtering like:

<code>
function myFilter(item, args) {

if (args.searchString != "" &&
item["title"].indexOf(args.searchString) == -1) {
return false;
}

return true;
}
<code>

Simply apply 'toLowerCase()' or 'toUpperCase()' to both the search
string and the item.title field and you have case insensitive
filtering.

Gerardo Pacheco Chalchis

unread,
May 30, 2012, 1:09:32 AM5/30/12
to slic...@googlegroups.com
hello my contribution is not much and I hope not annoying for someone
but I found a post that command (IndexOf) does not work in IE9
in the url here talk about it

http://stackoverflow.com/questions/7792195/ie9-array-does-not-support-indexof
--
Gerardo Pacheco

neoswf

unread,
May 30, 2012, 10:45:36 AM5/30/12
to slic...@googlegroups.com
Thank you so much Jeremy. Didn't know of the existence of this builtin methods.
I think it will be a good idea to Fork SG and add this to the code. It's a must.

Better- I'll add option to the suer to define if the filtering will be case sensitive or not

Thank you!

neoswf

unread,
May 30, 2012, 10:46:50 AM5/30/12
to slic...@googlegroups.com
To support indexOf in ie we need to implement this type of mechanism


Shlomi.

Shlomi Asaf

unread,
May 30, 2012, 10:56:10 AM5/30/12
to slic...@googlegroups.com
But Geraldo- The filter is working to me in IE9. Maybe you have some other issue? something missing?
Reply all
Reply to author
Forward
0 new messages