Search rendered currency data

Search rendered currency data

huanneil619huanneil619 Posts: 1Questions: 1Answers: 0
edited June 2020 in Free community support

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

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923
    Answer ✓

    For my serverside php file:

    Does this mean you have server side. processing (serverSdie: true) enabled? If so it's up to your server script to perform the search. The client side has no involvement with searching or sorting.

    Kevin

This discussion has been closed.