Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82234

Search rendered currency data

$
0
0

I am looking for a way to search the rendered result, I have tried the filter option for render but I am having issues getting it to work.

For my serverside php file:

$columns = array(
        array(
            'db' => 'amount',
            'dt' => 'withdrawal'
         )
    );

Under my columns settings in my JS for the table I have:

columns:[
{
    data: "withdrawal",
    render: {
        "filter":  $.fn.dataTable.render.number(',', '.', 2, '$ ')
        "display":  $.fn.dataTable.render.number(',', '.', 2, '$ ')
    }
}]

Now on my datatable, if I have a cell with data as 15, it displays the cell as $ 15.00 but when I search for that row, I must search using 15 and cannot search using 15.00. Same goes for $ 15.10, I must search for 15.1 and not 15.10


Viewing all articles
Browse latest Browse all 82234

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>