Fork me on GitHub
Show:

LimitedCollection

Summary

Maintains a version of a source collection which is limited to a specified length.

Constructor

aeris.LimitedCollection

Syntax

aeris.LimitedCollection

(
  • options.sourceCollection
  • options.limit
)

Summary

Parameters:

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:

at

Syntax

at

(
  • index
)
Model

Summary

Retrieve a model from the collection by index.

Parameters:

Returns:

bindToSourceCollection_

Syntax

bindToSourceCollection_

() private

Summary

enforceLimit_

Syntax

enforceLimit_

() private

Summary

getSourceCollection

Syntax

getSourceCollection

() Collection

Summary

Returns:

getSourceLength

Syntax

getSourceLength

() Number

Summary

Returns:

getSourceModels_

Syntax

getSourceModels_

(
  • count
)
Array.<model> private

Summary

Parameters:

  • count Number

    Number of source models to retrieve.

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

push

Syntax

push

() protected

Summary

remove

Syntax

remove

(
  • models
)

Summary

Remove models from the collection.

Parameters:

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

validateConstructorParams_

Syntax

validateConstructorParams_

(
  • opt_models
  • options
)
protected static

Summary

Parameters:

validateModel_

Syntax

validateModel_

(
  • model
)
private

Summary

Parameters:

Properties

length

Syntax

length

Unknown

Summary

The number of models in the collection.

limit_

Syntax

limit_

Number private

Summary

model

Syntax

model

Function

Summary

modelOptions_

Syntax

modelOptions_

Object protected

Summary

Options to pass on to models created by this collection.

sourceCollection_

Syntax

sourceCollection_

aeris.Collection private

Summary

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:

remove

Syntax

remove

Summary

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

Event Payload: