I have a requirement where I need to add the first column and its subsequent row values as Checked or Unchecked checkbox. The issue that I am facing as of now is one of dynamic data from the server side. Here, both column Name and Row Values are coming from the server side. Here is the code.
$('#SettingsDatatable').dataTable({
"order": [],
"dom": "Bfrtip",
"buttons": ["copy", "csv", "excel", "pdf", "print"],
"columnDefs": [{
"className": "dt-center", "orderable": false, "width": 20
}],
"columns": dataObject[0].columns,
"data": dataObject[0].data
});
How can I add the checkbox column and how can it be checked and unchecked based on the value from dataObject[0].data
? Please help. Thanks.
you can use
columnDefs
to render custom htmlHere is the solution using PHP, MySQL & jQuery. Please convert according to your need for e.g.
Client side (jQuery):
Server side (PHP + MySQL)