DataTable表工具不显示任何内容

时间:2014-11-24 12:59:56

标签: javascript jquery datatable tabletools

我已将此JavaScript if语句添加到我的MVC 5项目中,但是这不会将表工具添加到页面中,我也没有控制台错误。

if ($(".table").hasClass("ExportDataTable")) {
    $('.table').dataTable({
        "columnDefs": [
          { "type": "date", "targets": 0 }
        ],
        "order": [[0, "desc"]],
        responsive: true,
        "dom": 'T<"clear">lfrtip',
        "oTableTools": {
            "sSwfPath": "http://cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls.swf",

        }
    });
}
else {
    $('.table').dataTable({
        "columnDefs": [
          { "type": "date", "targets": 0 }
        ],
        "order": [[0, "desc"]],
        responsive: true
    });
}

0 个答案:

没有答案