ons-pull-hook

Component that adds Pull to refresh functionality to an <ons-page> element. It can be used to perform a task when the user pulls down at the top of the page. A common usage is to refresh the data displayed in a page.

Tutorial

Attributes

Name Type Default Value Description
disabled If this attribute is set the “pull-to-refresh” functionality is disabled. Optional.
height String Specify the height of the component. When pulled down further than this value it will switch to the “preaction” state. The default value is “64px”. Optional.
threshold-height String Specify the threshold height. The component automatically switches to the “action” state when pulled further than this value. The default value is “96px”. A negative value or a value less than the height will disable this property. Optional.
fixed-content If this attribute is set the content of the page will not move when pulling. Optional.

Properties

Name Description
onAction This will be called in the action state if it exists. The function will be given a done callback as it’s first argument.
height The height of the pull hook in pixels. The default value is 64px.
thresholdHeight The thresholdHeight of the pull hook in pixels. The default value is 96px.
state Current state of the element.
pullDistance The current number of pixels the pull hook has moved.
disabled Whether the element is disabled or not.

Events Summary

Name Description
changestate Fired when the state is changed. The state can be either “initial”, “preaction” or “action”.

Events

changestate

Fired when the state is changed. The state can be either “initial”, “preaction” or “action”.

Parameters
Name Type Description
event Object Event object.
event.pullHook Object Component object.
event.state String Current state.

Discussion

Need Help?

If you have any questions, use our Community Forum or talk to us via Gitter chat. The Onsen UI team and your peers in the community will work together to help solve your issues.

For bug reports and feature requests use our GitHub Issues page.