I am trying to make datatables sort my columns. The first column works okay as it\'s a simple number. However the next column is an input field. When I try to make that sort
If you decide to use the columns option where you are rending information from a JSON file you can easily add a hidden span on your render property. It appears as though DataTables looks for text to order and if it cannot find any, it will break. The example at https://datatables.net/examples/plug-ins/dom_sort.html uses a table that has already been rendered. Here is an example using an API:
...columns([{
"data": "receivedDate",
"render": function (data, type, row, meta)
{
if (data == "null")
{
return "";
}
else
{
return "" + moment(data).format('MM/ DD / YYYY') + "";
}
}
}]);