Skip to content

Latest commit

 

History

History
163 lines (126 loc) · 8.84 KB

FlexScrollView.md

File metadata and controls

163 lines (126 loc) · 8.84 KB

FlexScrollView

Flexible FlexScrollView for famo.us.

Key features:

  • Customizable layout (uses ListLayout by default)
  • Insert/remove at any position using animations
  • Support for true size renderables
  • Pull to refresh (header & footer)
  • Horizontal/vertical direction
  • Top/left or bottom/right alignment
  • Pagination
  • Option to embed in a ContainerSurface
  • FlexScrollView linking

Inherited from: ScrollController

FlexScrollView ⇐ ScrollController

Kind: Exported class
Extends: ScrollController

new FlexScrollView(options)

Param Type Description
options Object Configurable options (see ScrollController for all inherited options).
[options.pullToRefreshHeader] Renderable Pull to refresh renderable that is displayed when pulling down from the top.
[options.pullToRefreshFooter] Renderable Pull to refresh renderable that is displayed when pulling up from the bottom.
[options.leadingScrollView] FlexScrollView Leading scrollview into which input events are piped (see Tutorial)
[options.trailingScrollView] FlexScrollView Trailing scrollview into which input events are piped (see Tutorial)

flexScrollView.getPosition ⇒ number

Deprecated

Returns the position associated with the Scrollview instance's current node (generally the node currently at the top).

This function is a shim provided for compatibility with the stock famo.us Scrollview.

Kind: instance property of FlexScrollView
Returns: number - The position of either the specified node, or the Scrollview's current Node, in pixels translated.

Param Type Description
[node] number If specified, returns the position of the node at that index in the Scrollview instance's currently managed collection.

flexScrollView.setOptions(options) ⇒ FlexScrollView

Patches the FlexScrollView instance's options with the passed-in ones.

Kind: instance method of FlexScrollView
Returns: FlexScrollView - this

Param Type Description
options Object Configurable options (see ScrollController for all inherited options).
[options.pullToRefreshHeader] Renderable Pull to refresh renderable that is displayed when pulling down from the top.
[options.pullToRefreshFooter] Renderable Pull to refresh renderable that is displayed when pulling up from the bottom.
[options.leadingScrollView] FlexScrollView Leading scrollview into which input events are piped (see Tutorial).
[options.trailingScrollView] FlexScrollView Trailing scrollview into which input events are piped (see Tutorial).

flexScrollView.sequenceFrom(node) ⇒ FlexScrollView

Sets the data-source (alias for setDataSource).

This function is a shim provided for compatibility with the stock famo.us Scrollview.

Kind: instance method of FlexScrollView
Returns: FlexScrollView - this

Param Type Description
node Array | LinkedListViewSequence Either an array of renderables or a viewSequence.

flexScrollView.getCurrentIndex() ⇒ Number

Returns the index of the first visible renderable.

This function is a shim provided for compatibility with the stock famo.us Scrollview.

Kind: instance method of FlexScrollView
Returns: Number - Index of the first visible renderable.

flexScrollView.goToPage(index, [noAnimation]) ⇒ FlexScrollView

Paginates the Scrollview to an absolute page index. This function is a shim provided for compatibility with the stock famo.us Scrollview.

Kind: instance method of FlexScrollView
Returns: FlexScrollView - this

Param Type Description
index Number view-sequence index to go to.
[noAnimation] Bool When set to true, immediately shows the node without scrolling animation.

flexScrollView.getOffset() ⇒ number

Returns the offset associated with the Scrollview instance's current node (generally the node currently at the top).

This function is a shim provided for compatibility with the stock famo.us Scrollview.

Kind: instance method of FlexScrollView
Returns: number - The position of either the specified node, or the Scrollview's current Node, in pixels translated.

flexScrollView.getAbsolutePosition() ⇒ number

Returns the absolute position associated with the Scrollview instance.

This function is a shim provided for compatibility with the stock famo.us Scrollview.

Kind: instance method of FlexScrollView
Returns: number - The position of the Scrollview's current Node, in pixels translated.

flexScrollView.showPullToRefresh([footer]) ⇒ FlexScrollView

Shows the pulls-to-refresh renderable indicating that a refresh is in progress.

Kind: instance method of FlexScrollView
Returns: FlexScrollView - this

Param Type Description
[footer] Bool set to true to show pull-to-refresh at the footer (default: false).

flexScrollView.hidePullToRefresh([footer]) ⇒ FlexScrollView

Hides the pull-to-refresh renderable in case it was visible.

Kind: instance method of FlexScrollView
Returns: FlexScrollView - this

Param Type Description
[footer] Bool set to true to hide the pull-to-refresh at the footer (default: false).

flexScrollView.isPullToRefreshVisible([footer])

Get the visible state of the pull-to-refresh renderable.

Kind: instance method of FlexScrollView

Param Type Description
[footer] Bool set to true to get the state of the pull-to-refresh footer (default: false).