我正在尝试使用datatable将列作为超链接,但没有成功
函数successCallback(responseObj){
$(document).ready(function() {
$('#example').dataTable( {
"data":responseObj ,
"bDestroy": true,
"deferRender": true ,
"columns": [
{ "data": "infomation" },
{ "data": "weblink" },
]
} );
} );
}
我需要weblink来显示链接并成为该列中的超链接,以便用户可以单击并重定向到其他页面。我查看了render,但由于链接上的信息较少,我无法成功地做到这一点
我也研究了这个{a2},但没有什么帮助
使用^{} API方法动态生成单元格的内容
有关代码和演示,请参见this example
如果您希望基于其他列数据添加链接,则可以使用以下方法
我刚刚更改了渲染函数
data
仅指当前列数据,而row
对象指整行数据。因此,我们可以使用它来获取该行的任何其他数据从documentation开始。这对我来说非常清楚和直截了当,你不明白的具体是什么?你看到了什么错误
有关更完整的示例,请参见here
相关问题 更多 >
编程相关推荐