将复选框添加到jquery数据表

Lal*_*lit 4 jquery datatables

我是JQuery的新手.谁能告诉我如何将复选框添加到jquery dataTable?

Vis*_*hal 22

我想你在这里使用的是jQuery datatables插件:

您可以使用该aoColumnDefs参数自定义列,如 -

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
}]
Run Code Online (Sandbox Code Playgroud)