josecebe / twbs-pagination

jQuery pagination plugin (bootstrap powered)
http://josecebe.github.io/twbs-pagination/
Other
1.1k stars 405 forks source link

Uncaught Error: Start page option is incorrect #190

Closed CouldBeFree closed 4 years ago

CouldBeFree commented 5 years ago
function paginationInit(pages) {
  paginationItem.twbsPagination('destroy');
  paginationItem.twbsPagination({
    totalPages: pages,
    visiblePages: 5,
    next: 'Next',
    prev: 'Prev',
    startPage: current,
    hideOnlyOnePage: true,
    initiateStartPageClick: false,
    onPageClick: function (event, page) {
      var target = $('#label-search');
      appendPagination = false;
      index = page - 1;
      current = page;
    }
  })
}

I have this error when i go the last page of the pagination. I tried this https://github.com/josecebe/twbs-pagination/issues/43#issuecomment-136288053 but with no success. Any ideas?

eugenesimakin commented 4 years ago

The answer why the startPage is incorrect is here - jquery.twbsPagination.js#L21. Please, check the initial value of the start page.

ajeetpal12 commented 4 years ago

put ( paginationItem).twbsPagination({