#16587 closed enhancement (fixed)
ScrollableView should notify me when it is and the end of the scrolling
Reported by: | cjolif | Owned by: | Eric Durocher |
---|---|---|---|
Priority: | low | Milestone: | 1.9 |
Component: | DojoX Mobile | Version: | 1.8.3 |
Keywords: | Cc: | avasiliu | |
Blocked By: | Blocking: |
Description
In order to be able to for example get additional data when reaching the end of a list I need to be notified when the ScrollableView is reaching the end of a list.
Attachments (4)
Change History (12)
comment:1 Changed 9 years ago by
Cc: | avasiliu added |
---|
comment:2 Changed 9 years ago by
Milestone: | tbd → 1.9 |
---|
comment:3 Changed 9 years ago by
Priority: | undecided → low |
---|
comment:4 Changed 9 years ago by
actually adjustDestination does not fit exactly my needs because it waits for the touch interaction to end before being notified where in my case I want to start refreshing seamlessly without ending initial interaction.
comment:5 Changed 9 years ago by
I suggest to add scroll events to scrollable (beforescroll and afterscroll) to be notified of scrolling. Each scroll event will contain the following attributes:
- x: x coordinate of the scroll destination;
- y: y coordinate of the scroll destination;
- beforeTop: a boolean that is true if the scroll detination is before the top of the scrollable;
- beforeTopHeight: the number of pixels before the top of the scrollable for the scroll destination;
- afterBottom: a boolean that is true if the scroll destination is after the bottom of the scrollable;
- afterBottomHeight: the number of pixels after the bottom of the scrollable for the scroll destination.
I will be possible to cancel a scroll in the beforescroll event handler, by returning the value false.
I also propose to update the resize method of ScrollableView so that if the view is resized while scrolling is perfomed, the dimensions are updated accordingly and the scroll bars are also resized accordingly (which is not currently the case).
I'm attaching a patch with an implementation proposal.
Changed 9 years ago by
Attachment: | ticket16587.patch added |
---|
Add scroll events to scrollable (beforescroll and afterscroll), and fix the ScrollableView resize method so that it works properly when called during a scroll (IBM CCLA).
Changed 9 years ago by
Attachment: | pullToRefresh.patch added |
---|
pull to refresh example using scrolling events (IBM CCLA).
comment:7 Changed 9 years ago by
I'm adding an example of a "pull to refresh" implementation using the new scroll events.
Changed 9 years ago by
Attachment: | pull-arrow.png added |
---|
image referenced in pullToRefresh.patch (IBM CCLA).
Changed 9 years ago by
Attachment: | release-arrow.png added |
---|
image referenced in pullToRefresh.patch (IBM CCLA).
current solution is to override adjustDestination and use the method parameters to compute if we are out of the range, however an event might simplify this. As we have already a solution put it low priority.