Render ajax true/false as checkbox?

Render ajax true/false as checkbox?

stephanbstephanb Posts: 36Questions: 11Answers: 0

I've seen posts about setting className: 'select-checkbox' in columnDefs, but that doesn't seem to work for what I'm trying.

My ajax data contains columns that have a true/false string as content, and I see those values in the rendered table.
How do I render values in Datatables (and Editor) as either a checked or unchecked checkbox?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 12,287Questions: 25Answers: 2,875
    Answer ✓

    I've seen posts about setting className: 'select-checkbox' in columnDefs, but that doesn't seem to work for what I'm trying.

    That is for use with the Select Extension and selecting rows with a checkbox. See this example.

    How do I render values in Datatables (and Editor) as either a checked or unchecked checkbox?

    See if this Editor example helps. It uses 0 or 1 for the checked state. Maybe you can change it to true or false.

    Kevin

Sign In or Register to comment.