buttons and Show entries

buttons and Show entries

jamarchijamarchi 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:

Answers

  • kthorngrenkthorngren Posts: 21,382Questions: 26Answers: 4,959
  • jamarchijamarchi Posts: 6Questions: 3Answers: 0

    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' ] ],

  • kthorngrenkthorngren Posts: 21,382Questions: 26Answers: 4,959
    Answer ✓

    dom: 'Bfrtip'

    You need to add the l parameter of dom option.

    Kevin

  • jamarchijamarchi Posts: 6Questions: 3Answers: 0

    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'
    ],

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    It's because you removed the B from your dom options.

  • jamarchijamarchi Posts: 6Questions: 3Answers: 0

    Ah ok, Great, thank you for your help

  • LucasBLLucasBL Posts: 6Questions: 1Answers: 0

    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: '' }, { extend: 'csv', text: ' Exportar a CSV' }, { extend: 'excel', text: '' }, 'pageLength' ], }); table.buttons().container() .appendTo('#datatable_wrapper .col-md-6:eq(0)'); });
This discussion has been closed.