如何在jquery.datatables中显示复选框?

我正在使用Datatables,我有以下代码来生成表。 我想显示read,write,execute和admin值的复选框。 如果该值等于1,我希望选中该复选框。 如果未选中0复选框。

使用Javascript

 $(document).ready(function() { var oTable = $('#example').dataTable( { "sScrollY": "500px", "bPaginate": false, "bProcessing": true, "sAjaxSource": "sources/sample.json" } ); } );  

HTML

 
Browser Read Write Execute Admin

JSON

 { "aaData": [ ["Trident","0","0","0","1"], ["Trident","0","1","0","0"], ["Trident","0","0","1","1"], ["Trident","0","0","1","1"], ["Trident","0","0","1","1"], ["Trident","0","0","0","0"], ["Gecko","1","1","1","1"], ["Gecko","0","0","0","1"], ["Other browsers","1","0","0","U"] ] } 

我能够使用datables mrenderer使它工作

 $(document).ready(function () { var oTable = $('#example').dataTable({ "aoColumnDefs": [{ "aTargets": [0], //"mData": "download_link", "mRender": function (data, type, full) { if (data == "Gecko") { return 'https://stackoverflow.com/questions/14128939/how-to-show-checkboxes-in-jquery-datatables/' + data + ' Download Gecko'; } else { return 'https://stackoverflow.com/questions/14128939/how-to-show-checkboxes-in-jquery-datatables/' + data + ' Download'; } } }, { "aTargets": [1], //"mData": "download_link", "mRender": function (data, type, full) { if (data == "1") { return ''; } else { return ''; } } }, { "aTargets": [2], //"mData": "download_link", "mRender": function (data, type, full) { if (data == "1") { return ''; } else { return ''; } } }, { "aTargets": [3], //"mData": "download_link", "mRender": function (data, type, full) { if (data == "1") { return ''; } else { return ''; } } }, { "aTargets": [4], //"mData": "download_link", "mRender": function (data, type, full) { if (data == "1") { return ''; } else { return ''; } } }], "bFilter": false, "sScrollY": "500px", "bPaginate": false, "bProcessing": true, "sAjaxSource": "sources/sample.json" }); });