Multiple options not working

Multiple options not working

linksdesignlinksdesign Posts: 11Questions: 5Answers: 0
edited July 2019 in Free community support

Hope someone can help as I've been at this for hours! I have a table where I need to use two options: print/export buttons and also the selector for number of records. However, I can't get them to both display. Here's the code I have:

$(document).ready( function () {
   $('#CPDtable').DataTable({
       dom: 'Bfrtip',
        buttons: [
            'copy', 'csv', 'excel', 'pdf', 'print'
        ],
        lengthMenu: [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] ]
});
} );

The table is only displaying the buttons, not the records selector. Can someone advise what I need to change in the above code to make it work? I've tried every combination and code order I can think of!

This question has an accepted answers - jump to answer

Answers

  • rf1234rf1234 Posts: 2,808Questions: 85Answers: 406
    edited July 2019 Answer ✓

    dom: 'Bfrltip'
    should do the trick. The “l“ for length is missing.
    You might also need to turn paging on, if not done yet.

  • linksdesignlinksdesign Posts: 11Questions: 5Answers: 0

    Wow, thank you so much for the speedy response - and such a simple fix too! It's working now!

This discussion has been closed.