Fork me on GitHub
Show:

ViewCollection

Extends aeris.Collection

Summary

A representation of a data collection, which has been reshaped into a form expected by a view.

Constructor

aeris.util.aeris.ViewCollection

Syntax

aeris.util.aeris.ViewCollection

()

Summary

Methods

addViewModel_

Syntax

addViewModel_

(
  • dataModel
)
private

Summary

Add a view model.

Parameters:

  • dataModel Model

    The data model to associate with the view model.

bindToDataCollection_

Syntax

bindToDataCollection_

() private

Summary

createViewModel_

Syntax

createViewModel_

(
  • dataModel
)
ViewModel protected

Summary

Create a view model, associated with a specified data model.

Parameters:

Returns:

fetchData

Syntax

fetchData

(
  • opt_options
)
Promise

Summary

Parameters:

  • opt_options Object=

    Options to pass to aeris.Model#fetch.

Returns:

getData

Syntax

getData

() Collection

Summary

Returns:

proxyDataSyncEvents_

Syntax

proxyDataSyncEvents_

() private

Summary

removeViewModel_

Syntax

removeViewModel_

(
  • dataModel
)
private

Summary

Remove a view model.

Parameters:

  • dataModel Model

    The associated data model.

updateModelsFromData_

Syntax

updateModelsFromData_

() private

Summary

Reset view models, to sync up with our data model.

Properties

data_

Syntax

data_

aeris.Collection private

Summary

Data collection.

viewModelLookup_

Syntax

viewModelLookup_

Object. private

Summary

A cache of created view model instances, referenced by their associated data model cid.

Events

data:request

Syntax

data:request

Summary

The bound data collection has made an API request.

Event Payload:

  • viewCollection aeris.ViewCollection
  • promiseToSync aeris.Promise

    Resolves with raw API response data.

data:sync

Syntax

data:sync

Summary

The data API has responded to a request, and the view collection's bound data object has been updated with fetched data.

Event Payload:

  • viewCollection aeris.ViewCollection
  • responseData Object

    Raw API response data.