Hiding pagination when the table only has a single page when filtering
Hiding pagination when the table only has a single page when filtering
mleppala
Posts: 8Questions: 2Answers: 0
Is there a way to hide the pagination controls when there is only one page that display after you filter the table with and filtering, like text search, column filter and page length?
This discussion has been closed.
Answers
This problem was solved, I was pointed to creating my own pagination plugin to not display the pagination when all rows are displayed. So for anyone that needs it see https://datatables.net/plug-ins/pagination/ for reference.
On the return line just add 'pages === 1 ? '' : ', for example
What do you think about adding this feature either set as Datatable parameter to not display the pagination when all the rows are displayed or as as static code as I have in the example?
This should be default behaviour; it shouldn't require a plugin.
Thanks for the feedback. Personally I find it useful for the pagination to explicitly state that there is only one page. However, you can modify the library to suit your needs (that's what open source is all about ).
Allan