将Datatable列更改为html表单

时间:2018-06-06 02:46:09

标签: jquery ajax laravel-5 datatable axios

如何将日期信息发送到数据表中的按钮。

$(function () {
    $('#table').DataTable({
        ajax: {
            "url": "https://api-sandbox.londontheatredirect.com/rest/v2/Events/" + showId + "/Performances",
        },
        columns: [
            { data: 'PerformanceId' },
            { data: 'PerformanceDate' }
        ]
    });
    /**/
});

1 个答案:

答案 0 :(得分:0)

$(function () {
$('#table').DataTable({
    ajax: {
        "url": "https://api-sandbox.londontheatredirect.com/rest/v2/Events/" + showId + "/Performances",
    },
    columns: [
        { data: 'PerformanceId' },
        { data: 'PerformanceDate' },

        /*Here the code how you render your html button, a tag or anything else*/
        {
           "render": function (data, type, row, meta)
           { return '<a href="your_url" class="btn btn-sm btn-info">Button name</a>'; }
         }
    ]
  });
/**/
});

For better understand Read this