buttons and Show entries
buttons and Show entries
jamarchi
Posts: 6Questions: 3Answers: 0
Hi, I´m new using DataTables but I really like this
I have a question, I could add export buttoms but now I can´t see the Show entries comboox, Is there a way to move the buttons and that Show entries comboox appears ?
thank you
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Please see this FAQ:
https://datatables.net/faqs/index#buttons-page-length
Kevin
Hi Kevin, thank you for your answer, look I added this code but doesn´t show correctly and I can´ translate "Show 10 rows", Thank you for your help
dom: 'Bfrtip',
lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 Filas', '25 Filas', '50 Filas', 'Mostrar todo' ]
],
You need to add the
l
parameter ofdom
option.Kevin
Hi
I changed as you mentioned... but now I can´t see the export buttons
```dom: 'lfrtip',
lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 Filas', '25 Filas', '50 Filas', 'Mostrar todo' ]
],
buttons: [
{ extend: 'pdf', text: '<i class="fas fa-file-pdf fa-1x" aria-hidden="true"> Exportar a PDF</i>' },
{ extend: 'csv', text: '<i class="fas fa-file-csv fa-1x"> Exportar a CSV</i>'},
{ extend: 'excel', text: '<i class="fas fa-file-excel" aria-hidden="true"> Exportar a EXCEL</i>' },
'pageLength'
],
It's because you removed the B from your dom options.
Ah ok, Great, thank you for your help
I was doing some tests with the code of the colleague above and found that in my button show length is on the right side and not on the left, how to change it?
$(document).ready(function () { var table = $('#datatable').DataTable({ select: true, dom: 'Blfrtip', lengthMenu: [ [10, 25, 50, -1], ['10 Filas', '25 Filas', '50 Filas', 'Mostrar todo'] ], dom: 'Bfrtip', buttons: [ { extend: 'pdf', text: ' Exportar a PDF' }, { extend: 'csv', text: ' Exportar a CSV' }, { extend: 'excel', text: ' Exportar a EXCEL' }, 'pageLength' ], }); table.buttons().container() .appendTo('#datatable_wrapper .col-md-6:eq(0)'); });Answered in the other thread.
https://datatables.net/forums/discussion/57950/my-button-show-length-is-on-the-right-side-and-not-on-the-left-how-to-change-it#latest