Conditionally show page selection

Conditionally show page selection

hnhegdehnhegde Posts: 68Questions: 17Answers: 0

Hello,
Is there a way to set 'p' option in dom if the number of pages > 1 ? ie., if there is only one page worth of data to display, I would like to skip showing pagination.

Regards,
Harsha

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @hnhegde ,

    Not as such, the dom, and paging can only be set at initialisation. If your data is in the DOM, you can run a check before initialising (something like this). If the data comes from an Ajax, you would have to count the rows returned and then reinitialise.

    Hope that helps,

    Colin

  • hnhegdehnhegde Posts: 68Questions: 17Answers: 0

    Hi @colin ,
    Thanks for the response. That technique worked. But the lazy coder in me wanted something bite size :) After scouring over more forum threads, came across this wonderful plugin: conditionalPaging

    Wonder why this is not listed in the official list of plugins.

    Regards,
    Harsha

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @hnhegde ,

    Nice, I wasn't aware of that either :)

    Cheers,

    Colin

This discussion has been closed.