columnDefs无法正常工作

时间:2016-03-31 17:27:23

标签: angularjs datatables

我正在尝试在datatables api中添加一个额外的列,但它没有添加它,我试过这个没有效果

columnDefs:[{
               data: null,
               defaultContent: "<a href='javascript:void(0)'>Open</a>",
               targets:-1
            }]

当我尝试这个时,

 columns: [
            { data: "RequestStatus", name: "RequestStatus" },
            { data: "RequestNo", name: "RequestNo" },
            { data: "RequestDate", name: "RequestDate" },
            { data: "Requestor", name: "Requestor" },
            { data: "Item", name: "Item" },
            { data: "RequiredDate", name: "RequiredDate" },
            { data: "ItemStatus", name: "ItemStatus" },
            { data: "Technician", name: "Technician" },
            { data: "DeliveryMethod", name: "DeliveryMethod" },
            { data: "LastModified", name: "LastModified" },
            { data: null, defaultContent: "<a href='javascript:void(0)'>Open</a>" } // this one
           ]

我开始在angularjs文件中收到错误

  

错误:n [m]未定义

0 个答案:

没有答案