How to disable pagination for small tables

How to disable pagination for small tables

kj_rkkj_rk Posts: 1Questions: 1Answers: 0

I see examples of disabling pagination and ordering on the examples page. Can I add a logic to check the number of rows in the table and disable these features for small tables (where numOfRows <= 5) or any number of our choice.

Thanks in advance

Answers

  • kthorngrenkthorngren Posts: 21,348Questions: 26Answers: 4,955

    You will need to check for the number of rows before initializing Datatables. You can then use a boolean variable in the init code to enable/disable paging and ordering.

    Kevin

Sign In or Register to comment.