Bootstrap

datatable 在表格内容添加超链接

aocolumeDef.这个里面去定义.return返回的字符串会代替原来cell里面的内容

//  列默认参数
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 0 ] }, //隐藏第一列 第一列的值用于编辑或者删除
{ "bSortable": false, "aTargets": [ 1 ] }, //第二列为num列
{ "bSortable": false, "aTargets": [ 2],
"mRender":function(data,type,full) {
return "<a href='viewJobConfigure?jobId="+full.jobId+"'>"+ full.jobName+"</a>";
}
}, //第三列为jobName
{ "bSortable": true, "aTargets": [ 3 ] }, //第四列允许排序
],




"aoColumns": [
{"mDataProp":null,"mData" : null,
//添加对应的功能
"mRender" : function(mData,type,full) {
var html = [];
html.push('<div class="checkbox " οnclick="t_checkbox(this)"><input name="tempId" type="checkbox" value="'+full.id+'"></div>');
return html.join('');
} },
{"mDataProp":null,"mData" : null,
//添加对应的功能
"mRender" : function(mData,type,full) {
var html = [];
html.push('<a href="javascript:openInfo(\''+full.id+'\')">'+full.tempName+'</a>');
return html.join('');
} }, //列对应的属性值
{"mDataProp":"tempType"},
{"mDataProp":"deptName"},
{"mDataProp":"paramCount"}
],

转载于:https://www.cnblogs.com/T8023Y/p/4731892.html

;