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

Improve "updated" event #601

Open
scrobbleme opened this issue Jun 12, 2018 · 5 comments
Open

Improve "updated" event #601

scrobbleme opened this issue Jun 12, 2018 · 5 comments

Comments

@scrobbleme
Copy link

Hello,

It would be great if the updated event could have some parameters, ie. the original event.

Our specific use case: we want to do something if the paging was invoked (scroll to top of list).

@javve
Copy link
Owner

javve commented Dec 18, 2018

Hmm, sounds like a reasonable usecase. What do you think about instead adding a specific callback for paginationChange or something like that?

@scrobbleme
Copy link
Author

"paginationChange" would be fine es well.

@sheffieldnikki
Copy link
Contributor

sheffieldnikki commented Feb 6, 2019

My use case for something like paginationChange is for Double pagination, where if the user has clicked on paginationBottom I'd like to override the browser scroll position after the list has been updated, so that the paginationBottom element is visible at the bottom of the browser window. e.g.

document.getElementById('paginationBottom').scrollIntoView(false);

(my workaround for now is to use the "onclick" event to set a flag that is then used in my "updated" event handler:

var pBotClick;
document.getElementById('users').addEventListener('click', 
  function(){pBotClick = false}, true);
document.getElementById('pagesBottom').addEventListener('click',
  function(){pBotClick = true}, true);

note addEventListener(..., true) is during the capturing phase. i.e. before the click can trigger a list.js update.)

@YZirkind
Copy link

duplicate of #486

@Stolzenhain
Copy link

where if the user has clicked on paginationBottom

in your case, it's possible to use event bubbling on the the pager container, as explained at Cannot use trigger('click') or click on pagination

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

5 participants