U4-11452 - umbPagination directive does not update when pagesize dynamically changed

Created by Marcel van Helmont 18 Jun 2018, 08:11:03 Updated by Sebastiaan Janssen 25 Jun 2018, 09:40:55

Tags: PR

Your report will have a greater chance of being addressed if you can give us clear steps to reproduce the issue, please answer the following questions in as much detail as possible: What did you do? Created a custom property editor that uses a umbPagination directive with a pagesize dropdown.

What did you expect to happen? pagination control update correctly.

What actually happened? the total pages changes but the page buttons remains the same. So if you have 10 items and a pagesize of 5 then you get 2 pages. Changing this by the dropdown control is not getting updated and still shows 2 pages even when page size is set to 10.

1 Attachments

Download TestDashBoard.zip


Poornima Nayar 18 Jun 2018, 08:45:46

PR https://github.com/umbraco/Umbraco-CMS/pull/2705

Dave Woestenborghs 19 Jun 2018, 06:48:29

Hi @mvanhelmont

I tried to reproduce this on the dev-v7 branch. And I can't reproduce it.

I created a test dashboard to reproduce it. If I click on the pagination links on top the number of pages in the pagination directive get updated correctly.

Dave Woestenborghs 19 Jun 2018, 06:48:53

By the way the test dashboard is attached.

Sebastiaan Janssen 19 Jun 2018, 06:51:23

Thanks @dawoe - I was also just looking to figure out how to reproduce the issue. @mvanhelmont can you look at Dave's code and point out what he is doing differently from you please?

Marcel van Helmont 20 Jun 2018, 08:51:05

@dave @sebastiaan Thanks for your quick response.. After a long evening yesterday i finally found the different. If you remove ng-if="totalPages" (this is also not in de documentation) then you get the same result i have in your sample code. I have absolutely no idea why this is necessary.

also curious why there is a watch inside the directive and not the activate(); on the goToPage, prev and next functions it's the same result. Not fixing the ng-if but just curious.

Dave Woestenborghs 21 Jun 2018, 07:54:13

@mvanhelmont i will test it again. I think I have the ng-if there to hide the pager when there are no results.

Marcel van Helmont 21 Jun 2018, 07:59:45

But totalPages will always be true because of you setting it initial to 0. The current if statement check only if totalPages had been defined or am i missing something?

Dave Woestenborghs 22 Jun 2018, 14:38:21

Hi @mvanhelmont

I could reproduce it without having the ng-if statement.

And I can confirm your PR fixes it. Will do some extra testing.


Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions:

Due in version: 7.12.0


Story Points: