custom filtering using custom select in grid header

I seem to have a simple problem, i.e. it should work but doesn’t. I would like to filter a column with cells that may contain multiple items for the presence of which I would like to filter:

e.g. cell content like: " some string 1
some string 2 "

on which mygrid.filterBy apparently won’t work, since it seems to look for exact matches.

So what I want to do is define a custom dropdown/select in the header, just like in one of your answer in another post:

mygrid.attachHeader(“A,some string 1some string 2,C”);

only that I want to call my own function, something like this:


which then should call (here with an alert for testing purposes):

function doFilter(item) { alert("filtering for "+item.toString() ); };

The filter shows fine. However, this function is never called… can you tell me why? Would there be a better option for filtering? Combo seems to be the solution of choice …

Sorry in case I am missing a simple javascript syntax problem - I do not have much experience with javascript.

However, this function is never called…
You code seems correct , and actually it works in my local sample ( html file attached )

>>on which mygrid.filterBy apparently won’t work
filterBy can accept a “comparation function” instead of strict value

    //comparation code here
    if (some_check(value)) return true;
    else return false;
}); (955 Bytes)