Different page number links in desktop and mobile view?
Different page number links in desktop and mobile view?
asle
Posts: 96Questions: 28Answers: 0
I want to display only 3 pagination links in mobile view but standard number of page number links in desktop view. My table is using responsive. I cah set standard page numbers with this code. But how can I set a page.numbers_length depending on the view?
$.fn.DataTable.ext.pager.numbers_length = 4;
How can I set this value only in mobile view? I don't want to hide them, just show fewer page number links.
This question has an accepted answers - jump to answer
Answers
At the moment you can't I'm afraid. I agree though, the paging component needs to be more responsive. It is something that is on the cards for a feature release.
Allan
Assuming $.fn.DataTable.ext.pager.numbers_length is applied globally to all DataTables, is there a way to assign different numbers_length values to individual tables?
No - not at this time. It is something I'd like to do in future, but it isn't available yet.
Allan