I have a problem with jQuery dataTable sorting. It sorts columns in wrong order. For example: I have numbers from 1 to 5, when I click to sort that column it sorts in random order: 4, 1, 3, 5, 2. It's not only with number type. String, date - same problem. I have my data in MySQL database and I get it in json format. My datatable code:
var dataTable = $('#user_data').DataTable({
"processing" : true,
"serverSide" : true,
"order" : [],
"ajax" : {
url:"data_control/orders/fetch.php",
type:"POST"
},
"drawCallback": function( settings ) {
paint();
},
columnDefs: [
{
"orderable": false,
targets: [11, 12, 13, 14]
}
]
});
As I already mentioned - I select my data from database in fetch.php file in JSON format. Any ideas how to solve my problem with sorting? Thanks!