I have a datatable with 'date' column of type String. Now, when I want to sort by it, it's obviously not sorting properly for obvious reasons, so I changed the sType to 'date' and everything is fine.
The problem however is when I change the sType from string to something else, I cannot sort by this column anymore. Initial sort after page load is sorted and fine, but I can't click the column anymore to sort by it. It behaves like bSortable is false, but it isn't (debugged it). bSort is also true.
Moreover, I've tried implementing custom comparators, including sort plugins etc. same results.
Any ideas what might be causing the problem?
EDIT:
My datatable init process:
$('#scanDataTable').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": '<""l>t<"F"fp>',
"aaSorting": [[0, "asc"]],
"iDisplayLength": "100",
"aoColumnDefs": [
{"sType": "date", "aTargets": [0]}
]
});
If the "sType" parameter is string, clicking on the column header switches between asc and desc sorting (but it's string so the sorting is incorrect). After switching "sType" to date or anything else than string, clicking on table header does nothing.
As I mentioned earlier, I tried with "bSortable": true in column 0 options and "bSort": true in dataTable options, and imported custom sorting plugins, but it doesn't change anything. My date format is: 17.11.2014 21:54:39.
Important: After messing a bit with aaSorting, I noticed that both asc and desc sorting is the same which probably means that the sorting itself is the problem, and not the table options.