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

171
Views
Bootstrap DataTable: Disable sorting in one specific column, but only front-end

The website:

Part of my code:

function listaProjetos(){
  $('#datatable').DataTable({
        ///////////////     
        "columnDefs": [
            { "orderData": 1, "targets": 0 },
            { "orderData": [2, 1], "targets": 1 },
        ],      
        ///////////////

Basically, I need to change the column AÇÃO, to remove the arrows, and remove the function where clicking on the name will will sort the table.

However, I can't use the function:

{ "orderable": false, "targets": 2 }

I tried to use this to make the column "AÇÃO" not have an arrow anymore, but that meant the function { "orderData": [2, 1], "targets": 1 }, stops working, because column 1 needs column 2 to work.

There is another way to make sure only the first two columns will be sortable? Will I have to use CSS?

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!