Is there a way to limit the number of options on the pager for mobile devices?

Is there a way to limit the number of options on the pager for mobile devices?

luisrortegaluisrortega Posts: 79Questions: 6Answers: 1

Is there a way to limit the number of pages displayed by the pager object?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    There are a few default paging styles you can choose from - see pagingType. If none of those suit your needs, there are a few additional plugins. And if none of those are doing it for you, you can create your own using one of those other plugins as a template.

    Colin

  • luisrortegaluisrortega Posts: 79Questions: 6Answers: 1

    Thanks Colin, that was right on point...

    for future readers I added a bit of code to adjust depending on the screen size.

    const  GetPageingType = function(){
        console.log(screen.width);
        if (screen.width < 321) {return "full"} // iphone se
        else if (screen.width < 421) {return "first_last_numbers"} //pixel 4
        else {return "full_numbers"} //"desktop"
    }
    

    I could use other types, but this will work for me.

    Also I wrapped the page length and paging on classes, so I can also adjust positions by using

    sDom:'<"top">rt<"dt-bottom"lp>'
    

    iPhone SE

    Pixel 4

    Desktop

This discussion has been closed.