Datatables buttons not working.
Datatables buttons not working.
timmy4all
Posts: 4Questions: 2Answers: 0
$('#openQuotesTable').DataTable({
'oLanguage' : {
'sSearch' : 'Search',
'scrollX': true
},
dom: 'Bfrtip',
buttons: [
'pageLength'
],
bAutoWidth:false
});
This is how i initialize the datables. but i get error in console.
TypeError: api.init is not a function
dataTables.buttons..js (line 1598, col 6)
var opts = api.init().buttons || DataTable.defaults.buttons;
This discussion has been closed.
Answers
Are you attempting to add a button for pageLength? Normally I see the buttons are for things like copy, excel, pdf. The length selection features appear all by themselves if you add the "l" in the dom option and you can set the various length options from the length menu.
https://datatables.net/reference/option/lengthMenu
I also recommend moving up to dataTables 1.10.x. A number of your options are using the older values.
@glenderson. Thanks for your reply. My datatables version is 1.10.4 . The buttons dont work at all, not just for pagelength but for other stuff as well. I am avoiding upgrade to 1.10.10 because i will have to change a lot of things , almost 30-40 datatables will be affected if I upgrade. do the buttons not work with 1.10.4?
There is the issue. Update to the current release is always the first step when looking into errors.
Allan