Add row with checkbox checked

Add row with checkbox checked

gaiapuffogaiapuffo Posts: 3Questions: 2Answers: 0

Hi, I have a central function in my project that change every table in datatable. My problem is that for one datatable I have to insert one row dinamically.
So I have an rails array data like this

data=[]
data.push("<input type='checkbox' checked='checked'")

and after

$(".container-remote-data table").DataTable().row.add(<%= data.to_json.html_safe %>).draw().node();

The checkbox is reported in the Datatable but is not checked. I have to implement column definition for checked??? But this is a problem because I use a central function to generate datatable...Any solution?

Answers

  • allanallan Posts: 63,871Questions: 1Answers: 10,522 Site admin

    Happy to take a look at the problem if you post a link to a test page showing the issue please. I don't immediately see what is wrong there.

    Allan

This discussion has been closed.