SubsetCollection
Summary
A collection which acts as a subset of another (source) collection.
A SubsetCollection defines rules for filtering models from a source collection. The SubsetCollection will sync to all changes in the source collection. If filtered rules are changed on the SubsetCollection, it will be updated with models from the soure collection accordingly
Constructor
Item Index
Methods
Methods
bindToSourceCollection_
Syntax
bindToSourceCollection_
()
private
Summary
fetch
Syntax
Summary
Fetches data from the underlying source collection.
Parameters:
-
opt_options
Object=
Returns:
getFilteredSourceModels_
Syntax
Summary
isUnderLimit
Syntax
Summary
Does the collection have fewer models than the specified limit?
If no limit is set, this will always return true.
Returns:
normalizeSourceCollection_
Syntax
normalizeSourceCollection_
()
private
Summary
proxyRequestEvents_
Syntax
proxyRequestEvents_
()
private
Summary
removeFilter
Syntax
removeFilter
()
Summary
Stops filtering models from the source collection.
removeLimit
Syntax
removeLimit
()
Summary
Stops limiting the number of models from the source collection to set on the SubsetCollection.
resetToSourceModel_
Syntax
resetToSourceModel_
()
private
Summary
setFilter
Syntax
setFilter
-
filter
-
opt_ctx
Summary
Sets a filter to be used when syncing the SubsetCollection to it's source collection.
The filter receives a source collection models as an argument. If the filter returns true, the model will be added to the SubsetCollection.
Set the filter to null to disable filtering.
setLimit
Syntax
setLimit
-
limit
Summary
Limits the number of models from the source collection to set on the SubsetCollection.
Parameters:
-
limit
Number