更新时间:2023-10-31 16:07:10
通过将这一行"function(data,type,full,meta)"放入渲染函数中并使用full参数可能会解决您的问题.
By putting this line 'function(data, type, full, meta)' in your render function and use full parameter might solve your problem.
例如:
$(document).ready(function () {
var oTable = $('#example').DataTable({
"ajax": "/Users/GetUsers",
"columns": [
{ "data": "UserName", },
{ "data": "FirstName", },
{ "data": "LastName", },
{ "data": "Gender", },
{ "data": "Email", },
{ "data": "IsActive", },
{ "data": "PhoneNumber", },
{ "data": "Address", },
{
"data": "UserId", "width": "50px", "render":
//change
function(data, type, full, meta) {
return '<a class="popup" href="/Users/Edit/' + data + '">Edit</a>';
}
},
{
"data": "UserId", "width": "50px", "render":
//change
function(data, type, full, meta) {
return '<a class="popup" href="/Users/Delete/' + data + '">Delete</a>';
}
}
]
});
});
注意::如果以上方法不能解决问题,请参见下面的链接中的注释,您会有所想法.
Note : if above doesn't solve problem ,see the comments in the below link , you will get an idea.