Fork me on GitHub
Show:

ViewCollection

Summary

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

Constructor

aeris.ViewCollection

Syntax

aeris.ViewCollection

()

Summary

Methods

_prepareModel

Inherited from Backbone.Collection but overwritten in ../src/collection.js:122

Syntax

_prepareModel

() private

Summary

Pass modelOptions on to newly created models.

add

Syntax

add

(
  • models
)

Summary

Add models to the collection.

Parameters:

addViewModel_

Syntax

addViewModel_

(
  • dataModel
)
private

Summary

Add a view model.

Parameters:

  • dataModel Model

    The data model to associate with the view model.

at

Syntax

at

(
  • index
)
Model

Summary

Retrieve a model from the collection by index.

Parameters:

Returns:

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:

isValid

Syntax

isValid

() Boolean=

Summary

Runs validation on all collection models.

Returns:

Boolean=:

Returns false if any model fails validation.

parse

Syntax

parse

() protected

Summary

pop

Syntax

pop

() protected

Summary

proxyDataSyncEvents_

Syntax

proxyDataSyncEvents_

() private

Summary

push

Syntax

push

() protected

Summary

remove

Syntax

remove

(
  • models
)

Summary

Remove models from the collection.

Parameters:

removeViewModel_

Syntax

removeViewModel_

(
  • dataModel
)
private

Summary

Remove a view model.

Parameters:

  • dataModel Model

    The associated data model.

reset

Syntax

reset

(
  • opt_models
)

Summary

Remove and replace all models in the collection.

Parameters:

set

Syntax

set

() protected

Summary

shift

Syntax

shift

() protected

Summary

slice

Syntax

slice

() protected

Summary

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.

length

Syntax

length

Unknown

Summary

The number of models in the collection.

model

Syntax

model

Function

Summary

modelOptions_

Syntax

modelOptions_

Object protected

Summary

Options to pass on to models created by this collection.

viewModelLookup_

Syntax

viewModelLookup_

Object. private

Summary

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

Events

add

Syntax

add

Summary

When a model is added to the {aeris.Collection}.

Event Payload:

change

Syntax

change

Summary

When any child model's attribute changes

Event Payload:

change:[attribute]

Syntax

change:[attribute]

Summary

When any child model's attribute changes, where [attribute] is the name of the attribute.

Event Payload:

data:request

Syntax

data:request

Summary

The bound data collection has made an API request.

Event Payload:

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:

remove

Syntax

remove

Summary

When a model is removed from the {aeris.Collection}.

Event Payload: