display data differently in AJAX table

display data differently in AJAX table

mesqueebmesqueeb Posts: 38Questions: 12Answers: 1

How can I display data differently in an AJAX table?
E.g.:

$('#myTable').DataTable( {
    ajax: ...,
    columns: [
        { data: 'name' },
        { data: 'price' },
        { data: 'id' },
    ]
} );

I want to make the following two column changes:

{ data: 'price' } → price*1.08
{ data: 'id' } → "http://url.com/"+id

And I want to have one column that can show 2 values from the JSON, e.g. firstname+" "+lastname

I've looked into https://datatables.net/reference/option/columnDefs
but I failed to figure out how to use this in combination with my AJAX setup.

Any ideas?

Answers

This discussion has been closed.