I'm using angularjs datatable and trying to use button plugin in this page
.withButtons([
'columnsToggle',
'colvis',
'copy',
'pdf',
'excel',
{
text: 'Some button',
key: '1',
action: function (e, dt, node, config) {
alert('Button activated');
}
}
]);
I get Unknown button type: 'columnsToggle', and 'colvis' but when I remove 'columnsToggle', and 'colvis' from code it run without any problems but other button not display except custom button
{
text: 'Some button',
key: '1',
action: function (e, dt, node, config) {
alert('Button activated');
}
}
copy,pdf, excel don't appears,Can anyone help me to fix the problem please?
I'm using angularjs datatable and trying to use button plugin in this page https://l-lin.github.io/angular-datatables/#/withButtons
.withButtons([
'columnsToggle',
'colvis',
'copy',
'pdf',
'excel',
{
text: 'Some button',
key: '1',
action: function (e, dt, node, config) {
alert('Button activated');
}
}
]);
I get Unknown button type: 'columnsToggle', and 'colvis' but when I remove 'columnsToggle', and 'colvis' from code it run without any problems but other button not display except custom button
{
text: 'Some button',
key: '1',
action: function (e, dt, node, config) {
alert('Button activated');
}
}
copy,pdf, excel don't appears,Can anyone help me to fix the problem please?
Share Improve this question edited Oct 30, 2015 at 12:08 Gyrocode. 58.9k16 gold badges156 silver badges191 bronze badges asked Oct 29, 2015 at 12:05 Ali-AlrabiAli-Alrabi 1,6986 gold badges30 silver badges61 bronze badges2 Answers
Reset to default 10I had the same problem as you and I find out all the datatables-buttons js files needed to be included:
<script type="text/javascript" src="~/Scripts/datatables-buttons/js/dataTables.buttons.js"></script>
<script type="text/javascript" src="~/Scripts/datatables-buttons/js/buttons.bootstrap.js"></script>
<script type="text/javascript" src="~/Scripts/datatables-buttons/js/buttons.jqueryui.js"></script>
<script type="text/javascript" src="~/Scripts/datatables-buttons/js/buttons.colVis.js"></script>
<script type="text/javascript" src="~/Scripts/datatables-buttons/js/buttons.flash.js"></script>
<script type="text/javascript" src="~/Scripts/datatables-buttons/js/buttons.html5.js"></script>
<script type="text/javascript" src="~/Scripts/datatables-buttons/js/buttons.print.js"></script>
for excel and csv add this cdn
<script src="https://cdn.datatables/buttons/1.5.1/js/buttons.html5.min.js"></script>
<script src="https://cdnjs.cloudflare./ajax/libs/jszip/3.1.3/jszip.min.js"></script>
for PDF file option add this cdn
<script src="https://cdnjs.cloudflare./ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare./ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>