jquery jtable 如何使某一列变为超链接,具体代码是啥? 20

PR_NO:{key:true,edit:false,width:'12%',title:'@Resources.ApproveListResource.prno'}... PR_NO: {
key: true,
edit: false,

width: '12%',
title: '@Resources.ApproveListResource.prno'

}
展开
 我来答
育知同创教育
2016-10-31 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
展开全部
aocolumeDef.这个里面去定义.return返回的字符串会代替原来cell里面的内容

e.g:
datatable=$('#dt_basic').dataTable({
"bAutoWidth": false,
"bStateSave":true,
"sPaginationType": "bootstrap_full",
"sAjaxSource":url,
"sAjaxDataProp": "poolList",
"aoColumns": [{ "sTitle":"ID", "mDataProp": "poolId","sClass":"center"},
{ "sTitle":"存储池名称", "mDataProp": "poolName","sClass":"center"},
{ "sTitle":"运行状态", "mDataProp": "status","sClass":"center"},
{ "sTitle":"缓存状态", "mDataProp": "iscache","sClass":"center"},
{ "sTitle":"总容量", "mDataProp": "diskPack.poolSize","sClass":"center"},
{ "sTitle":"使用率", "mDataProp": "diskPack.usage" ,"sClass":"td-progress center"},
{ "sTitle":"操作","mDataProp": "objectId","sClass":"center"},
{ "sTitle":"创建时间", "mDataProp": "createTime","sClass":"center"}
],
"aoColumnDefs":[{"aTargets":[6],"mRender":function(data,type,full){
return "<a href=\"#myModal-edit\" data-toggle=\"modal\" onclick=\"preUpdate('"+data+"')\"> <i class=\"fa fa-lg-2 fa-pencil\"> </i> </a> <a href=\"javascript:void(0)\" data-toggle=\"modal\" class=\"smart-mod-eg1\" onclick=\"delPool('"+data+"',event)\"> <i class=\"fa fa-lg-2 fa-trash-o\"> </i> </a> "}
},
{"aTargets":[5],"mRender":function(data,type,full){
return data+"%<div class=\"progress\"><div aria-valuetransitiongoal=\""+data+"\" class=\"progress-bar bg-color-teal\" style=\"width: "+data+"%;\" aria-valuenow=\""+data+"\"> </div></div>";
}

},
{"aTargets":[2],"mRender":function(data,type,full){
if(data=='2'){
return "维护";
}else{
return "运行";
}
}
},

{"aTargets":[3],"mRender":function(data,type,full){
if(data=='1'){
return "是";
}else{
return "否";
}

}
},
{"aTargets":[0],"mRender":function(data,type,full){
return data+" <a href=\"#myModal-file\" data-toggle=\"modal\" onclick=\"viewpool('"+full.objectId+"',event)\"> <i class=\"fa fa-lg-2 fa-file-o \"></a>";
}
}
]
});
追问
根本牛头不对马嘴,我自己已经解决了
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式