Orderable with a Function
Orderable with a Function
greggreggreg
Posts: 42Questions: 19Answers: 2
I have a happy working table:
serverSide: true,
columns: [
{
title : "Name",
data: "name"
},{
title : "Address",
data: function (row) {
if (row.number !== null) {
ret = row.number + ' ' + row.street + ' ' + row.type + ', ' row.suburb;
return ret;
} else {
return "";
}
}
}
]
But I would like to make my Address Orderable. It seems when I am using a function, this becomes difficult. Is there a way to do this?
(note: this is not actually my data fields, but its the easiest way to explain it)
This question has an accepted answers - jump to answer
Answers
Always the case, work it out after posting.
https://editor.datatables.net/manual/php/formatters#Custom-formatters