Searching rendered column
Searching rendered column

I have a table with price amounts represented in JSON as plain numbers but am using columns.render
to format it as a price with a format like $5.25.
In my demo try searching for a dollar sign and see how nothing matches.
It seems possible this is somehow done using a custom render that keys on a type of filter
but I couldn't wrap my head around it.
Any ideas?
This discussion has been closed.
Replies
The Data Renderers doc states this:
So the use of
render: $.fn.dataTable.render.number(',', '.', 2, '$')
is only affecting what is displayed.If you want the
$
to be searchable then you will want to use Orthogonal Data so you can prefix the$
to the number for searching and display.You can use the same renderer just chain it with
.display(data)
. For example:http://live.datatables.net/jeveqino/1/edit
Kevin
Kevin, thanks for the update. This does work with the "$" now.
However, if the data shows "$1,500" using orthogonal data is there a way I can still match if someone tries searching for "1500"? It's basically being able to search on two separate strings.