When using a fixed header row to implement column-level filters, how can I return cells with a partial match?
ie: search term: "omato"
returns: automator, tomato etc.
When using a fixed header row to implement column-level filters, how can I return cells with a partial match?
ie: search term: "omato"
returns: automator, tomato etc.
Here is the coffeescript code I use to acheive this:
The line
grid.setSelectedRows([])
just clears any selected rows before applying the filter. If you don't do this then the selected rows you see on-screen do not match the underlying selected rows.More importantly the
return true unless hasFilter
line prevents any filtering work whilst the grid is loading, unless the user has actually typed into one of the boxes. I have found that this makes quite a difference to the performance of the grid when loading large datasets in batches of JSON data over http.Here is the input box handler that sets the
hasFilter
flag:Under MyFilter in the example replace this loop...
with this..
Seems so obvious now :)