how to complete checkbox with JSON from PHP?
how to complete checkbox with JSON from PHP?
cris_mf
Posts: 5Questions: 2Answers: 0
Hi!!
I make the checkbox adding this code in columnDefs.
{
'targets': 7,
'searchable':false,
'orderable':false,
'className': 'dt-body-center',
'render': function (data, type, full, meta){
return '<input type="checkbox" name="id[]" value="' + $('<div/>').text(data).html() + '">';
}
}
Now I try complete the checkbox with data from PHP in JSON. In console I can see that parametre 'full' contains all de data but I can´t manipulate it. I need to compare what is the value of JSON for mark each checkbox.
Sorry for my english and I waitting for a response
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
What is the logic condition that you need to use? Something like
checked="'+(full.checked ? 'checked' : '') + '"'
should do it.Allan
Hi Allan,
Thanks so much!!!! I was not sure with de sintaxis, the checkbox are working!