Datatable with pagination not shown when lesser than N rows

Datatable with pagination not shown when lesser than N rows

Evgeniy VasylievEvgeniy Vasyliev Posts: 23Questions: 7Answers: 1

Good day!

Can you please give an example or hint where to look to make datatable with pagination not shown when lesser than N rows?

Thank you!!!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    Hi @Evgeniy Vasyliev ,

    Paging is an initialisation option - paging - so you can't change the value after initialisation. If the table is in the DOM, you can just count the rows with $('table tbody tr').length then set the option at initialisation. If you're getting the rows from Ajax, you can do some logic in initComplete, count the rows page.info(). You could either set the page length long so all the rows are shown, or destroy() and reinitialise with paging disabled.

    Hope that helps,

    Cheers,

    Colin

  • Evgeniy VasylievEvgeniy Vasyliev Posts: 23Questions: 7Answers: 1

    Thank you, helpful.

This discussion has been closed.