We recently added custom search functionality to our table using the Search Plugin, pretty similar to the demo.
One issue we noticed is that the search query only checks against the cell value, not the displayed value. This is kind of counter-intuitive, I would expect it to compare with the displayed string value.
For example if you have a numeric column with format 0,0.00
and a cell has a value of 1000
then it displays 1,000.00
, however if you do a search for 1,000
you get 0 results, or if you do a search for 0.0
you also get 0 results. Only if you search for the raw source number 1000
(or a subset of that, like 100
) do you get results. This is counter-intuitive to users, they expect a search to be what you see is what you search for at the least. Ideally it should search both the source value and the rendered value.
Is this a known issue? Is there a setting to search against rendered value instead of the just source value?
Next, I tried using a custom search.queryMethod
. However, the same basic problem exists here: the callback only gives you each cell’s source value, not the actual displayed value. It also doesn’t give you the cell properties, so it’s basically impossible to determine what the displayed value may be.
Is there a solution?