在jQuery数据表中传递两个或更多Id列作为参数?

时间:2018-04-23 05:44:38

标签: javascript datatables datatables-1.10

我正在使用jQuery数据表。我通过<a href="#">传递了一个ID。现在,我希望在单个单元格和<a href="#">中传递两个或更多个ID。

我的代码

&#13;
&#13;
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;
&#13;
&#13;

现在我需要在一个渲染中传递userIdcompanyIdtendererIdhref link

如下所示

data = '<a href = "/admin/tenderer-reg-details/'+userId+'"/"'+companyId+'"/"'+tendererId +'">View</a>';

0 个答案:

没有答案