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: 20,148Questions: 26Answers: 4,736
    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

This discussion has been closed.