您好我正在尝试在数据表列中添加链接。我通过一系列对象引入信息。这是我的实施。如何添加带有链接的新列? 我希望链接文本是通用的,例如"链接"或者可以放入
等图标<a href="#"><i class="fa fa-desktop"></i></a>
var createDataTable = function(responseObj){
adminInfoTable = $('#adminInfoTable').DataTable({
data: responseObj,
"columns":[
{data:"Date"},
{data:"FullName"},
{data:"CrossPartyName"},
{data:"streetAddress"},
{data:"City"},
{data:"State"},
{data:"Zip5"}
]
});
}
答案 0 :(得分:1)
我想我想出了'&#34;列&#34;:[ {数据:&#34;日期&#34;}, {数据:&#34;全名&#34;}, {数据:&#34; CrossPartyName&#34;}, {数据:&#34;的StreetAddress&#34;}, {数据:&#34;市&#34;}, {数据:&#34;状态&#34;}, {数据:&#34; Zip5&#34;}, {数据:&#34; PlatBookPageUrl&#34;} ],
// sets custom render function for the 7th row PlatBookPageUrl
"columnDefs": [ {
"targets": 7,
"data": "PlatBookPageUrl",
"render": function ( data, type, full, meta ) {
return '<a target="_blank" href="'+data+'"><i class="fa fa-desktop"></i></a>';
}
} ],`