Class: Chart

Chart


new Chart()

React component consuming a Order Data Entity collection to feed a grid.

React component consuming a Order Data Entity collection to feed a grid
Author:
Source:

Extends

  • React.Component

Members


onAddDocEventListener

listen to add Order Data Entity change event on Data API.

listen to add Order Data Entity change event on Data API
Source:

onDeleteDocEventListener

listen to delete Order Data Entity change event on Data API.

listen to delete Order Data Entity change event on Data API
Source:

onEditDocEventListener

listen to edit Order Data Entity change event on Data API.

listen to edit Order Data Entity change event on Data API
Source:

Methods


<async, static> componentDidMount()

Called immediately after a component is mounted. Setting state here will trigger re-rendering.

Once component is monted we are now ready to start listen to changes on Order data entity and get a list of order in database to fill out the state.orders
Source:
Example
componentDidMount() {
  const { Order } = this.foundation.data

  // listen to add, edit and delete events on Order collection
  // and react to it
  this.onAddDocEventListener = Order.on('add', this.handlerChangeOrder)
  this.onEditDocEventListener = Order.on('edit', this.handlerChangeOrder)
  this.onDeleteDocEventListener = Order.on('delete', this.handlerChangeOrder)

  await this.setSeries()
}

<static> componentWillUnmount()

Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

lets stop listen to Order Data State Change Events
Source:
Example
componentWillUnmount() {
  const { Order } = this.foundation.data
  Order.stopListenTo(this.onAddDocEventListener)
  Order.stopListenTo(this.onEditDocEventListener)
  Order.stopListenTo(this.onDeleteDocEventListener)
}