Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
jQuery dataTables wrong sorting

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!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!