how to render then order ajax json data, specifically date values
how to render then order ajax json data, specifically date values
I am using datatables 1.10 with an ajax datasource and am struggling with the syntax for rendering then ordering the json data , specifically date values
My raw date data is in the form 2015-12-10 11:30:00 and my date column is displayed properly and sorts properly.
Using examples form the site as a guide, I have the following code snippet to render the date column, which uses the jquery-dateFormat.min.js to format the date values
{
"render": function ( data, type, row )
var rowvalue = row["EventDate"];
return ($.format.date(rowvalue, "E dd/MM/yyyy"));
},
"targets": 2
},
This works, and the dates are displayed as I want them but the sorting no longer works
From what I understand, I can use the render function to change the display, but also use it to sort by the original form
I tried following the example on http://datatables.net/manual/orthogonal-data#Computed-values
But can’t get it to work.
Would appreciate some pointers.
Thanks