How can I modify the function of "Next" button in pagination and put my own function

How can I modify the function of "Next" button in pagination and put my own function

okayeeokayee Posts: 22Questions: 6Answers: 0

I want to modify the pagination button. I have a dynamic table the loads data. I want to change the function of Next button to request additional data and load to the table

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,236Questions: 1Answers: 2,598
    Answer ✓

    Hi @okayee ,

    The easiest way is to disable the existing event handler in the drawCallback and create your own. It needs to be disabled on each draw, as the page draw would reactivate the default handler.

    See example here,

    Cheers,

    Colin

  • okayeeokayee Posts: 22Questions: 6Answers: 0

    Hello @colin
    Can you put pagination buttons on your example?

  • colincolin Posts: 15,236Questions: 1Answers: 2,598

    You just need to drop off the class, see this example here, that does all the pagination controls now.

  • okayeeokayee Posts: 22Questions: 6Answers: 0

    Hello @colin

    The drawCallback is work on me. I just simply change the a.pagination_button to li.pagination_button in able to detect the click in the button in pagination. Thanks a lot

  • okayeeokayee Posts: 22Questions: 6Answers: 0

    Another question is. How can I specifically call the paginated_button next class in this example?

  • okayeeokayee Posts: 22Questions: 6Answers: 0

    Ohh. it works. it just li.paginate_button.next. Thanks @colin

  • colincolin Posts: 15,236Questions: 1Answers: 2,598

    Yep, that was the first example I posted.

This discussion has been closed.