Pagination

Pagination

afoysalafoysal Posts: 4Questions: 1Answers: 0

How can I use both "pageLength": 10, & "paging": false, ??

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    pageLength has no meaning if paging is false - false means there is no paging, so everything will be displayed.

  • afoysalafoysal Posts: 4Questions: 1Answers: 0
    edited August 2019

    But I would like to remove row chooser and display 10 rows every page.

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Ah, so you want paging still. Use dom to remove the page selection menu - see here.

  • afoysalafoysal Posts: 4Questions: 1Answers: 0

    But this solution displaying 100 rows per page. I need below controls to display.

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    That's the Buttons extension.

  • afoysalafoysal Posts: 4Questions: 1Answers: 0
    edited August 2019

    Thanks @colin . I am using below code

                $('#elecList').DataTable( {
                            dom: 'Bfrtip',
                            buttons: [
                              'copy', 'csv', 'excel', 'pdf', 'print'
                            ],
                        "pageLength": 10,
                    } ); 
    

    This code gives me sorted result. But I need unsorted result. Thanks.

This discussion has been closed.