Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop B-Pagination from Resetting to 1 #7139

Open
rezaffm opened this issue Mar 25, 2023 · 0 comments
Open

Stop B-Pagination from Resetting to 1 #7139

rezaffm opened this issue Mar 25, 2023 · 0 comments

Comments

@rezaffm
Copy link

rezaffm commented Mar 25, 2023

Hi,

so, I have been pulling my hair out of this one.

I tried extending (overwriting) the component, but with no luck.

My goal is to stop b-pagination from resetting the current Page to 1 when I change the number of Pages by changing per Page to a different value, let's say from 10 to 25 or vice versa.

For instance, I tried to uncomment the setting of the page in the watcher, but no success:

  watch: {
    pageSizeNumberOfPages(newValue, oldValue) {
      if (!isUndefinedOrNull(oldValue)) {
        if (newValue.perPage !== oldValue.perPage && newValue.totalRows === oldValue.totalRows) {
          // If the page size changes, reset to page 1
          //  this.currentPage = 1
        } else if (
          newValue.numberOfPages !== oldValue.numberOfPages &&
          this.currentPage > newValue.numberOfPages
        ) {
          // If `numberOfPages` changes and is less than
          // the `currentPage` number, reset to page 1
          //  this.currentPage = 1
        }
      }
      this.localNumberOfPages = newValue.numberOfPages
    }
  },

It still keeps resetting the current Page.

Any help would be highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant