question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When switching data sources dir-pagination-controls displays wrong number of results

See original GitHub issue

The code below displays 37 pages when vm.totalResults is zero. The issue only happens in one scenario:

  1. Display a user with 37 results
  2. Hide that user data with ng-if go to another user with 0 results
  3. User displays 37 results.
  4. Refresh the page (F5 in browser) and now the pagination control goes away as it should as there are 0 results.

Why is this happening?

 <md-list-item dir-paginate="alert in vm.allAlerts | itemsPerPage: vm.pageSize" total-items="vm.totalResults" current-page="vm.currentPage" pagination-id="customerAlerts">

//More code...

  <dir-pagination-controls on-page-change="vm.alertsReload(newPageNumber)" layout="row" layout-align="center center" pagination-id="customerAlerts"></dir-pagination-controls>

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ot-brian-mackeycommented, Jul 29, 2015

After more research I see that dirPaginateDirective does not fire when I show/hide my data by toggling ng-if=. The app.Controller reloads, creating new state, but the said directive does not recompile and capture the new state when there is no data to display.

0reactions
ot-brian-mackeycommented, Jul 30, 2015

I will work on a plunker reproduction of the issue. This page only has 1 dir-pagination, however there are at least 2 others used in the site. I see three active, uniquely named paginationid’s in the paginationService.instances. One uses the __default name, however the one I am experiencing a problem with uses the name customerAlerts unique to this pagination controller.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why I get error on multiple dir-pagination in AngularJs?
I want to create pagination using angular. But when I added the pagination-id attribute it throw an error and the data doesn't load....
Read more >
Paging: DevExtreme - JavaScript UI Components for Angular ...
Paging is used to load data in portions, which improves the UI component's performance on large datasets. Paging is enabled by default. You...
Read more >
Guidelines for Creating Task Flows to Be Used in Oracle Composer ...
If fetchSize is greater than autoHeightRows , you can decide whether to display only as many records as the autoHeightRows value or provide...
Read more >
jQuery Grid Documentation - Paging - Kendo UI for ... - Telerik
Define the number of records for the Grid to display on each page. · Define the total number of records in the dataset....
Read more >
How To Query Tables and Paginate Data in Flask-SQLAlchemy
You'll order the results by a column value, and count and limit query results. Finally, you'll use pagination to display a certain number...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found