Class wink.plugins.ScrollToRefresh
Enables to trigger a refresh state, using a scroller, at the top or the bottom of the content. At least one section (top or bottom) is required.
- Defined in: scrolltorefresh.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
wink.plugins.ScrollToRefresh(properties)
|
| Compatibility list | Supported platforms / browsers |
|---|---|
|
iOS3, iOS4, iOS5, iOS6, Android 1.5, Android 2.1, Android 2.2, Android 2.3, Android 3.0, Android 3.1, Android 4.0, BlackBerry 6, BlackBerry 7, Bada 1.0, Windows Phone 8
|
| Wink Version compatibility | Supported Wink version |
|---|---|
|
1.4
|
Method Summary
Class Detail
wink.plugins.ScrollToRefresh(properties)
var ctx = {};
var scrollToRefresh = new wink.plugins.ScrollToRefresh(
{
scroller: new wink.ui.layout.Scroller(
{
target: 'scrollContent',
direction: 'y',
callbacks:
{
scrolling: { context: ctx, method: 'onScrolling' },
endScrolling: { context: ctx, method: 'onEndScrolling' }
}
}),
scrollerContent: wink.byId('scrollContent'),
topsection:
{
waitText: 'Pull down to refresh...',
triggeredText: 'Release to refresh...',
releasedText: 'Loading...',
spinner: new wink.ui.xy.Spinner({ background: "light", size: 20 })
},
bottomsection:
{
waitText: 'Pull up to load more...',
triggeredText: 'Release to refresh...',
releasedText: 'Loading...',
spinner: new wink.ui.xy.Spinner({ background: "light", size: 20 })
},
onTopReleased: function(callback) { // Refresh Job },
onBottomReleased: function(callback) { // Refresh Job }
}
ctx.onScrolling = wink.bind(scrollToRefresh.onScrolling, scrollToRefresh);
ctx.onEndScrolling = wink.bind(scrollToRefresh.onEndScrolling, scrollToRefresh);
- Parameters:
- {object} properties
- The properties object
- {wink.ui.layout.Scroller} properties.scroller
- scroller
- {HTMLElement} properties.scrollerContent
- The node of the content (target of the scroller)
- {object} properties.topsection Optional
- The top section properties (waitText, triggeredText, releasedText, spinner)
- {object} properties.bottomsection Optional
- The bottom section properties (waitText, triggeredText, releasedText, spinner)
- {function} properties.onTopReleased
- Function called when the scroller is scrolled to the top
- {function} properties.onBottomReleased
- Function called when the scroller is scrolled to the bottom
- Requires:
- wink.ui.layout.Scroller
- See:
- Test page
Field Detail
{integer}
uId
Unique identifier
Method Detail
-
onEndScrolling()Allows to notify the component that of a scroll end
-
onScrolling()Allows to notify the component that of a scroll