我正在使用jQuery数据表。我通过<a href="#">
传递了一个ID。现在,我希望在单个单元格和<a href="#">
中传递两个或更多个ID。
我的代码:
var table = $('table#companyTable').DataTable({
"sAjaxSource": ResultData, // "/GetcompanyList.json",
"sAjaxDataProp": "",
/// sort at column three
"order": [[ 3, "asc" ]],
"aoColumns": [
{ "mData": null },
{ "mData": "registrationType" },
{ "mData": "companyName" },
{ "mData": "emailId" },
{ "mData": "country" },
{ "mData": "district" },
{ "mData": "registrationDate" },
{ "mData": "companyId" },
{ "mData": "tendererId" },
{
"mData": "userId",
"render": function(data, type, row, meta){
if(type === 'display'){
data = '<a href = "/admin/tenderer-reg-details/'+data+'">View</a>';
}
return data;
}
}
],
// define first column , is column zero
"columnDefs": [{
"searchable": false,
"orderable": false,
"targets": 0
}]
});
&#13;
现在我需要在一个渲染中传递userId
,companyId
,tendererId
并href link
。
如下所示
data = '<a href = "/admin/tenderer-reg-details/'+userId+'"/"'+companyId+'"/"'+tendererId +'">View</a>';