showSelected button suggestions

showSelected button suggestions

mnbob70mnbob70 Posts: 19Questions: 2Answers: 0

showSelected is useful but IMHO it has one annoying issue where it resets the table to page 1 when toggling back to all rows. It would be even more useful if it left the table on the last page visited prior to toggling. An additional nice enhancement would be to toggle the button text between "Show selected rows" and "Show all rows".

Replies

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794

    @allan can comment on whether he will make these changes. In the meantime you could create a Custom Button with those changes. I found the showSelected button in select.js and built a custom button with that code:
    https://live.datatables.net/kunofihi/1/edit

    It sets the button().text() and uses page() to set the page and draw() with the page parameter to display the page without updating the sorting and searching. Just for fun I added the restorePage option so yo can control this via an option.

    Kevin

  • mnbob70mnbob70 Posts: 19Questions: 2Answers: 0

    Thank you! I'll give that a try. I LOL when I saw that you even had the same names that I was suggesting "Show selected rows" and "Show all rows".

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    There are a bunch of issues with jumping back to the same page, such as if they changed any of the table configuration (search, order, paging). I'm not sure that it is something I will add at this time unless there is more interest in such a feature from the community.

    Allan

Sign In or Register to comment.