Fork me on GitHub
Show:

Collection

Extends Backbone.Collection

Summary

Base collection class.

Constructor

aeris.util.aeris.Collection

Syntax

aeris.util.aeris.Collection

(
  • opt_models
  • opt_options
)

Summary

Parameters:

  • opt_models Array.<Model>=
  • opt_options Object
    • validate Boolean=

      If set to true, will validate all models on instantiation.

Item Index

Properties

Methods

_prepareModel

Syntax

_prepareModel

() private

Summary

Pass modelOptions on to newly created models.

at

Syntax

at

(
  • index
)
Model

Summary

Retrieve a model from the collection by index.

Parameters:

Returns:

isValid

Syntax

isValid

() Boolean=

Summary

Runs validation on all collection models.

Returns:

Boolean=:

Returns false if any model fails validation.

Properties

modelOptions_

Syntax

modelOptions_

Object protected

Summary

Options to pass on to models created by this collection.

Events

add

Syntax

add

Summary

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

Event Payload:

  • model aeris.Model
  • collection aeris.Collection

change

Syntax

change

Summary

When any child model's attribute changes

Event Payload:

  • model aeris.Model

change:[attribute]

Syntax

change:[attribute]

Summary

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

Event Payload:

  • model aeris.Model
  • value

remove

Syntax

remove

Summary

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

Event Payload:

  • model aeris.Model
  • collection aeris.Collection