this.dataTable_one = this.qid("completeToDo").dataTable({ searching: false, serverSide: false,//是否开启列排序 bProcessing: false, ordering: false, pageLength : 1000, "aaData":this.dealdata, "sDom":"t<i>", "columns": [ { "title": "<div><input type='checkbox' name='checkall'/><span style='padding-left:15px;'>全选</span></div>" ,"mData":"id","sWidth":70}, { "title": "待验证的项目" ,"mData":"itemPoint","sWidth":"20%"}, { "title": "完成情况" ,"mData":"improveRemark","sWidth":""}, { "title": "完成日期" ,"mData":"improveDate","sWidth":"10%"}, { "title": "验证人员" ,"mData":"confirmMan","sWidth":"20%"}, { "title": "验证情况" ,"mData":"confirmResult","sWidth":"10%"}, { "title": "验证日期" ,"mData":"confirmDate","sWidth":"10%"} ], "bInfo":false, "bDeferRender":false, "oLanguage": this._DATATABE_LANGUAGE, "aoColumnDefs": [ { "aTargets": 0, "sClass": "checkbox-td", "sContentPadding": "mmm", "mDataProp": "engine", "sDefaultContent": "--",//允许给列值一个默认值,只要发现null值就会显示默认值 "mRender": function (data, type, full) { var htmls="<div><input type='checkbox' name='checkfliter' data-data='"+JSON.stringify(full)+"'/><span style='padding-left:15px;'></span></div>"; return htmls; } }, { "aTargets": 1, "sClass": "itemPoint-td", "sDefaultContent": "--", "mRender": function (data, type, full) { var html="<a href='#' class='itemPoint' data-data='"+JSON.stringify(full)+"'>"+data+"</a></li>"; return html; } }, { "aTargets": 2, "mRender": function (data, type, full) { return data; } },{ "aTargets": 4, "mRender": this.proxy(function (data, type, full) { var htmls=["<ul style='padding-left:15px;list-style:none;'>"]; data && $.each(data,function(idx,item){ htmls.push("<li>"+(item.num || "")+" <a href='#' class='confirmMan' data-data ='"+JSON.stringify(item)+"'>"+item.name+"</a></li>"); }); htmls.push("</ul>"); return htmls.join(""); ; }) } ] });
jQuery的 dataTable 2
最新推荐文章于 2024-06-01 09:39:32 发布