Adding checkboxes to jquery datatable

datatables, jquery

Solution

I guess you're using the jQuery datatables plugin here:

You can use the `aoColumnDefs` parameter to customize a column, like-

aoColumnDefs  : [
{
    aTargets: [0],    // Column number which needs to be modified
    fnRender: function (o, v) {   // o, v contains the object and value for the column
        return '<input type="checkbox" id="someCheckbox" name="someCheckbox" />';
    },
    sClass: 'tableCell'    // Optional - class to be applied to this table cell
}]

Problem

I am new to JQuery. Can anyone tell me how to add checkboxes to a jquery dataTable?

Original source