【问题标题】:Change Datatable column to html form将 Datatable 列更改为 html 表单
【发布时间】:2018-11-15 14:49:29
【问题描述】:

如何将日期信息制作成数据表中的按钮。

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

【问题讨论】:

  • PerformanceId你想要按钮?

标签: jquery ajax laravel-5 datatable axios


【解决方案1】:
$(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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-08-29
    • 2015-01-15
    • 2017-08-23
    • 1970-01-01
    • 1970-01-01
    • 2019-04-25
    • 2018-07-06
    • 1970-01-01
    相关资源
    最近更新 更多