API Docs for: 1.0.0
Show:

eZ.AsynchronousView Class

Views extension providing the concept of asynchronously rendered view. An asynchronous view is first rendered in a loading state, then fires an event to get the missing data and when it gets them, it is rerendered. The loading errors are also handled and such a view can also have a retry button. When a view is extended with this extension, its initializer method should set the required properties _fireMethod and optionally:

  • the _watchAttribute to subscribe to the corresponding change event.
  • the _errorHandlingMethod to customize the error handling, otherwise the view is just rerendered in case of error

Methods

_retryLoading

(
  • e
)
protected

Tap event handler for the retry button. It resets the attribute which name is stored in the _watchAttribute property and the loadingError attribute and fires the loading event with the method in _fireMethod.

Parameters:

  • e Object

Properties

_errorHandlingMethod

Function protected

Holds the method to call when an error occurred. By default, it's render.

Default: this.render

_fireMethod

Function protected

Holds the method to call to fire the load event.

_triggerAttribute

String protected

Holds the attribute name which change event triggers the asynchronous process.

Default: 'active'

_watchAttribute

String protected

Holds the attribute name which stores the data needed to render the view. If provided, the asynchronous view will subscribe to the corresponding change event.

Attributes

loadingError

Boolean

Loading error state

Default: false