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

253
Views
Datatable column sorting based on non-rendered value

the following is my column definition for a last updated data field coming from the server:

$('#table').DataTable({
"columns": [{ 
  "searchable": true, 
  "data": "last_updated",
  "type": "date", 
  "render": function (data, type, row, meta) { 
      return "<a target=\"_blank\" href=\"/history/" + data.id + "\">" + timeDiff(new 
       Date(data.updated)) + "</a>" 
  }
}]
})

After the table data loads, the sorting occurs on the rendered value, but I want the sorting to occur on data.updated. How can I achieve this?

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!