table tool buttons not apperaing
table tool buttons not apperaing
Gobinda Nandi
Posts: 6Questions: 2Answers: 0
I am using portoadmin template. but unable to get pdf, excel or any other custom button on top of my table.
here is my config of datatable.
(function( $ ) {
'use strict';
var datatableInit = function() {
let pageTbl = $('#datatable-tabletools-setting-module');
window.datatableTabletoolsSettingModule = pageTbl.DataTable({
responsive: true,
serverSide : true,
processing : true,
bStateSave: true,
ajax: {
url: '<?php echo site_url('setting/get_module') ?>',
},
"columns": [
{
"bSortable" : false,
"orderable": false,
render: function ( data, type, row, meta ) {
return '<div class="checkbox-custom checkbox-default"><input type="checkbox" class="checkbox-rows" id="checkbox-setting-module-row-'+ meta.row +'"><label for="checkbox-setting-module-row-'+ meta.row +'"></label></div>';
}
},
{},
{},
{},
{
"bSortable" : false
}
],
sDom: "<'text-right mb-md'T>" + $.fn.dataTable.defaults.sDom,
oTableTools: {
sSwfPath: pageTbl.data('swf-path'),
aButtons: [
{
sExtends: 'pdf',
sButtonText: 'PDF'
},
{
sExtends: 'csv',
sButtonText: 'CSV'
},
{
sExtends: 'xls',
sButtonText: 'Excel'
},
{
sExtends: 'print',
sButtonText: 'Print',
sInfo: 'Please press CTR+P to print or ESC to quit'
},
]
}
});
};
$(function() {
datatableInit();
});
}).apply( this, [ jQuery ]);
Any help would be appreciated.
This discussion has been closed.
Replies
Hi @Gobinda Nandi ,
TableTools is a very old extension - this is now done by Buttons. It would be worth seeing if you could upgrade to the most recent version first.
Cheers,
Colin