angularUtils icon indicating copy to clipboard operation
angularUtils copied to clipboard

Change page again before async request is complete

Open anilanar opened this issue 10 years ago • 5 comments

I'm not sure if this is a bug or a problem on my side. When I double click either side of three dots, I get an infinite loop of some kind.

  1. When you click a page number: that number becomes active, shifts to left or to right synchronously, makes a request async.
  2. When you click a page number again: same as above.
  3. Request that was made by point 1) resolves. It updates data, current page, page size etc. At this point, current page in pagination control and current page of the request are different so there is some kind of a clash?
  4. Request that was made by point 2) resolves.

I cannot share any code. But I have an idea about the difference between common use case and my use case: I update current page and page size after each request.

So as a workaround, I want to disable pagination control during a request. Any suggestions? I don't think there's an ng-disabled on the pagination control.

Obviously I can do it inside on-page-change handler, I was just wondering if there's any way to apply "disabled" style to the whole element.

untitled screencast 1 1

anilanar avatar Mar 11 '16 16:03 anilanar

I made this commit as a quick fix to my situation. If you like the idea of having an ng-disabled attribute on the control, I can add tests, update docs etc. and make a pull request.

anilanar avatar Mar 13 '16 23:03 anilanar

Hi, thanks for the report and suggestion. I'll get around to properly reviewing this as soon as I have some free time in the next week or so.

michaelbromley avatar Mar 16 '16 20:03 michaelbromley

+1

stephanbarrett avatar May 31 '16 19:05 stephanbarrett

What is the solution?. Is this problem resolve in the new version?. thank ;)

Eduardoluisgm avatar Jun 23 '16 13:06 Eduardoluisgm

@Eduardoluisgm I implemented what @anilanar committed and it works well.

stephanbarrett avatar Jun 23 '16 14:06 stephanbarrett