How to keep the Select Info updated on serverSide pagination

How to keep the Select Info updated on serverSide pagination

TrevorWatTrevorWat Posts: 6Questions: 3Answers: 0

Hi all,

I'm using MVC Datatables with serverSide processing.

I have used the examples on the site to re-select items after paging back and forth, but when going to a new page I would like to keep the select info ("x rows selected") up to date.

Currently when going to a new page that select info disappears. When I go back to the previous page the items are selected and the accurate info appears (I had to change line 10 in this example to table.row(row).select(); to get the select info to appear).

Can someone tell me how I can keep it showing and up to date when paging?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,139Questions: 26Answers: 4,734
    Answer ✓

    Probably the easiest way is to use the Gryocode checkboxes plugin. It keeps track of the selected rows across server side pages and updates the info correctly.

    Or you can use infoCallback to update the info element. You may need to use select.info to stop the Select extension from updating the info element.

    Kevin

  • TrevorWatTrevorWat Posts: 6Questions: 3Answers: 0
    edited July 2021

    Oh my gosh, that is amazingly simple. Would You believe I've spent about 4 hours on this, haha. Thank you!

Sign In or Register to comment.