Кнопки datatables выдавали ошибку "set.inst.processing is not function"

https://datatables.net/extensions/buttons/examples/styling/bootstrap.html

Я пытаюсь сделать таблицу, как ссылку выше. Но когда я нажимаю кнопку, появляется странная ошибка:

dataTables.buttons.js: 1435 Uncaught TypeError: set.inst.processing не является функцией

at r.<anonymous> (dataTables.buttons.js:1435)
at r.each (dataTables.min.js:150)
at r.<anonymous> (dataTables.buttons.js:1434)
at r.<anonymous> (dataTables.min.js:155)
at r.processing (dataTables.min.js:154)
at r.action (buttons.html5.min.js:15)
at q (dataTables.min.js:233)
at HTMLAnchorElement.<anonymous> (dataTables.min.js:233)
at HTMLAnchorElement.dispatch (jquery-3.1.1.min.js:3)
at HTMLAnchorElement.q.handle (jquery-3.1.1.min.js:3)

Ниже приведен код моей страницы.

    <link href="~/Content/global/plugins/datatables/dataTables.min.css" rel="stylesheet" />
    <link href="~/Content/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/global/plugins/datatables/extensions/Buttons/css/buttons.dataTables.min.css" rel="stylesheet" />
    <link href="~/Content/global/plugins/datatables/extensions/Buttons/css/buttons.bootstrap.min.css" rel="stylesheet" />
    <script src="~/Content/assets/global/plugins/datatables/dataTables.min.js" type="text/javascript"></script>
    <script src="~/Content/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.min.js" type="text/javascript"></script>
    <script src="~/Content/global/plugins/datatables/extensions/Buttons/js/dataTables.buttons.js"></script>
    <script src="~/Content/global/plugins/datatables/extensions/Buttons/js/buttons.bootstrap.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/pdfmake.min.js"></script>
    <script src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/vfs_fonts.js"></script>
    <script src="~/Content/global/plugins/datatables/extensions/Buttons/js/buttons.html5.min.js"></script>
    <script src="~/Content/global/plugins/datatables/extensions/Buttons/js/buttons.print.min.js"></script>
    <script src="~/Content/assets/global/plugins/datatables/extensions/Buttons/js/buttons.colVis.min.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        var table = $('#sample_1').DataTable({
            "pagingType": "full_numbers",
            "ordering": false,
            dom: 'Bfrtip',
            buttons: [ 'copy', 'excel', 'pdf', 'print' ],
            initComplete: function () {
                this.api().columns([0, 1, 2]).every(function () {
                    var column = this;
                    var select = $('<br /><select class="form-control input-circle" style="max-width:100px;"><option
value=""></option></select>')
                        .appendTo($(column.header()))
                         .on('change', function () {
                            var val = $.fn.dataTable.util.escapeRegex($(this).val());
                            column.search(val ? '^' + val + '$' : '', true, false).draw();
                        });
                    column.data().unique().sort().each(function (d, j) { select.append('<option value="' + d + '">' + d + '</option>') });
                });
            }
        });
    }); </script>

0 ответов

Другие вопросы по тегам