例如,位置列应该具有来自位置列
的数据的超链接我试过,它只有位置栏的超链接
columnDefs: [
{
targets:1,
render: function (dataSet, type, row, meta) {
if (type === 'display') {
dataSet = '<a href="http://localhost/application/org?officeid=' + encodeURIComponent(dataSet) + '">' + dataSet + '</a>';
}
return dataSet;
}
}
]
答案 0 :(得分:1)
您需要访问row
属性。 row
表示整行数据,因此您可以通过索引引用它:
if (type === 'display') {
dataSet = '<a href="http://localhost/application/org?officeid=' + row[1] + '">' + dataSet + '</a>';
}
这假设第1列中的数据是我不确定您的数据中存在的Office ID,您可能必须修改您的查询以确保返回此信息。