如何使用json将包含按钮列的行添加到jquery数据表中

时间:2017-01-20 00:40:45

标签: jquery datatables

这是数据表定义

table = $('#example').DataTable({
    data: GetData4Grid(requino,0),
    columns: [
        {
            className: 'details-control',
            orderable: false,
            data: null,
            defaultContent: (requino != 0) ? '<button class="gridbtn">Select</button><br /><button class="gridbtnR">Remove</button>' : '',
        },
        { title: "Key" },
        { title: "Priority" },
        { title: "Part" },
        { title: "Description" },
        { title: "Quantity" },
        { title: "Unit_Cost" },
        { title: "Ext_Cost" },
        { title: "Vendor" },
        { title: "Status" },
        { title: "Due_Date" },
        { title: "Current_Approver" },
        { title: "Account" }
    ]
});

如果我从一开始就加载网格它工作正常......但是一旦初始化,如果我添加一个新行,按钮就不会显示

enter image description here

enter image description here

0 个答案:

没有答案