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

142
Views
How to render jQuery DataTable Boolean column with check and x?

I would like to use the following columnDef on two boolean columns to display a check for true and x for false. However, nothing gets displayed on the columns:

{
    targets: [5, 6],
    render: function (data, type, row) {
        return (data === true) ? '<span class="glyphicon glyphicon-ok txt-green"></span>' : '<span class="glyphicon glyphicon-remove txt-red"></span>';
    }
}

The following does work, but it is difficult to see the checkmarks for values that are true. I prefer the glyphicon option:

{
    targets: [5, 6],
    render: function (data, type, full, meta) {
        return data ? '<input type="checkbox" disabled checked/>' : '<input type="checkbox" disabled />';
    }
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The glyphicons example was not working because they are no longer supported in Bootstrap 4 and above.

The following is my solution using fontawesome icons:

{
    targets: [5, 6],
    render: function (data) {
        return data ? '<span class="fa fa-solid fa-check" style="color: green"></span>' : '<span class="fa fa-solid fa-times" style="color: red"></span>';
    }
}
about 4 years ago · Juan Pablo Isaza Report
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!