Datatable with pagination not shown when lesser than N rows
Datatable with pagination not shown when lesser than N rows
Evgeniy Vasyliev
Posts: 23Questions: 7Answers: 1
in DataTables
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
This discussion has been closed.
Answers
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 ininitComplete
, count the rowspage.info()
. You could either set the page length long so all the rows are shown, ordestroy()
and reinitialise with paging disabled.Hope that helps,
Cheers,
Colin
Thank you, helpful.