I have added datatable plugin in my project and my datatable is displaying but the buttons ( excel, pdf, etc) are not rendered at all.
Here's my code snippet:
table = $("#orders").DataTable({
dom: 'Bfrtip',
buttons: ['copy', 'csv', 'excel', 'pdf', 'print'],
....
Here's how it's rendered:
Here's my dependency list:
bundles.Add(new ScriptBundle("~/bundles/lib").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery-ui-{version}.js",
"~/Scripts/bootstrap.js",
"~/Scripts/bootbox.js",
"~/Scripts/respond.js",
"~/Scripts/datatables/jquery.datatables.js",
"~/Scripts/datatables/datatables.bootstrap.js",
"~/Scripts/datatables/buttons.bootstrap.js",
"~/Scripts/datatables/buttons.html5.js",
"~/Scripts/datatables/buttons.print.js",
"~/Scripts/typeahead.bundle.js",
"~/Scripts/toastr.js",
"~/Scripts/moment.js"
));
I am not getting the following error:
buttons.bootstrap.js:39 Uncaught TypeError: Cannot read property 'defaults' of undefined
I searched for this error and here it suggests to put the dependencies in order. But I do have my dependencies in order. Is there anything else I am missing ?