Mobile view: only 1 2 page numbers Plus 'Next' buttons

Mobile view: only 1 2 page numbers Plus 'Next' buttons

ntkuyatentkuyate Posts: 2Questions: 1Answers: 0

I want to show only 2 Page numbers for Mobile view
Current

Expected

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    You can't I'm afraid. What if you are on page 2? The user could either go forwards or backwards. It needs to be an odd number for the number buttons.

    DataTables 2 (releasing soon, and currently in the nightly build if you want to try it out) makes the paging buttons responsive, so it will remove any that cause it to flow on to a second line. It works much better for a mobile view.

    Allan

  • ntkuyatentkuyate Posts: 2Questions: 1Answers: 0
    edited January 30

    @allan Appreciate your feedback.

    What if you are on page 2? The user could either go forwards or backwards. It needs to be an odd number for the number buttons.

    P.S. The number of buttons are three 1 2 Next, 2 3 Next etc.
    If you find yourself on page 2, the user has the option to navigate either forwards or backwards.

    Pagination to be presented in the following scenarios:
    1)When there are two pages, the output show "Next" or "Prev" based on the current page.
    2)If there are three pages, the output to display "1 2 Next," and when on the 2nd or 3rd page, show "1 2 Next" or "Prev 2 3" accordingly
    3)In the case of four pages, the desired output "1 2 Next" initially, and adjusting as you navigate between pages, such as "1 2 Next," "1 2 Next," "2 3 Next," and "Prev 3 4" based on the current page.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    If the buttons are "2 3 Next " I don't understand how they would go back to page 1? It would need to be 1 2 3 Next.

    If you wanted a previous and next button to only appear when they were needed, you could just use a little CSS to hide them when they are disabled.

    Allan

Sign In or Register to comment.