RangeController source

Manages the selection and visible portion of given content, typically for a Repetition.

Specializes Montage

Properties

avoidsEmptySelection :boolean source

Whether to automatically reselect a value if it is the last value removed from the selection.

Off by default.

clearSelectionOnOrderChange :boolean source

Whether to automatically clear the selection whenever the sortPath, filterPath, or reversed knobs change.

Off by default.

contentConstructor :function source

Creates a content value for this range controller. If the backing collection has an intrinsict type, uses its contentConstructor. Otherwise, creates and returns simple, empty objects.

This property can be set to an alternate content constructor, which will take precedence over either of the above defaults.

deselectInvisibleContent :boolean source

Whether to automatically deselect content that disappears from the organizedContent.

Off by default.

filterPath :string source

An FRB expression that determines how to filter content like "name.startsWith('A')" to see only names starting with 'A'. If the filterPath is null, all content is accepted.

iterations :Array.<Iteration> source

An array of iterations corresponding to each of the values in organizedContent, providing an interface for getting or setting whether each is selected.

length :number source

The length of a sliding window over the content, suitable for binding (indirectly) to the scroll height. If start or length is null, all content is accepted.

multiSelect :boolean source

Whether to automatically deselect all previously selected content when a new selection is made.

Off by default.

organizedContent :Array.<Object> source

An array incrementally projected from content through sort, reversed, filter, visibleIndexes, start, and length.

reversed :boolean source

Whether to reverse the order of the sorted content.

selectAddedContent :boolean source

Whether to select new content automatically.

Off by default.

selection :Array|Set|SortedSet source

A subset of the content that are selected. The user may safely reassign this property and all iterations will react to the change. The selection may be null. The selection may be any collection that supports range change events like Array or SortedSet.

sortPath :string source

An FRB expression that determines how to sort the content, like "name" to sort by name. If the sortPath is null, the content is not sorted.

start :number source

The first index of a sliding window over the content, suitable for binding (indirectly) to the scroll offset of a large list. If start or length is null, all content is accepted.

visibleIndexes :?Array.<number> source

An array of indexes to pluck from the ordered and filtered content. The output will be an array of the corresponding content. If the visibleIndexes is null, all content is accepted.

Methods

add(value) → {boolean} source

Proxies adding content to the underlying collection, accounting for selectAddedContent.

Parameters:
Name Type Description
value
Returns: boolean

whether the value was added

addContent() source

Creates content and adds it to the controller and its backing collection. Uses add and contentConstructor.

Returns:

the value constructed and added

addEach(values) source

Proxies adding each value into the underlying collection.

Parameters:
Name Type Description
values object

callDelegateMethod(name) source

This method calls the method named with the identifier prefix if it exists. Example: If the name parameter is "shouldDoSomething" and the caller's identifier is "bob", then this method will try and call "bobShouldDoSomething"

Parameters:
Name Type Description
name string
Inherited From:

clear() source

Proxies clearing the underlying content collection.

clearSelection() source

A managed interface for clearing the selection, accounting for avoidsEmptySelection. You can however directly manipulate the selection, but that will update the selection asynchronously because the controller cannot change the selection while handling a selection change event.

delete(value) → {boolean} source

Proxies deleting content from the underlying collection.

Parameters:
Name Type Description
value
Returns: boolean

whether the value was found and deleted successfully

deleteEach(values) source

Proxies deleting each value out from the underlying collection.

Parameters:
Name Type Description
values object

deselect(value) source

A managed interface for removing values from the selection, accounting for avoidsEmptySelection. You can however directly manipulate the selection, but that will update the selection asynchronously because the controller cannot change the selection while handling a selection change event.

Parameters:
Name Type Description
value

equals(anObject) → {boolean} source

Returns true if two objects are equal, otherwise returns false.

Parameters:
Name Type Description
anObject Object

The object to compare for equality.

Inherited From:
Returns: boolean

Returns true if the calling object and anObject are identical and their uuid properties are also equal. Otherwise, returns false.

has(value) → {boolean} source

Does the value exist in the content?

Parameters:
Name Type Description
value object

the value to test for

Returns: boolean

initWithContent(content) source

Initializes a range controller with a backing collection.

Parameters:
Name Type Description
content

Any collection that produces range change events, like an Array or SortedSet.

Returns:

this

pop() source

Proxies popping content from the underlying collection.

Returns:

the popped value

push() → {boolean} source

Proxies pushing content to the underlying collection, accounting for selectAddedContent.

Parameters:
Name Type Description
...values
Returns: boolean

whether the value was added

select(value) source

A managed interface for adding values to the selection, accounting for multiSelect. You can however directly manipulate the selection, but that will update the selection asynchronously because the controller cannot change the selection while handling a selection change event.

Parameters:
Name Type Description
value

set:selection(a) source

Parameters:
Name Type Description
a Collection

collection of values to be set as the selection.

shift() source

Proxies shifting content from the underlying collection.

Returns:

the shifted value

splice() source

Proxies splicing values into the underlying collection. Accounts for * selectAddedContent.

Returns:

the resulting content

swap(index, minusLength, plus) → {Array} source

Proxies swapping values in the underlying collection. Accounts for * selectAddedContent

Parameters:
Name Type Description
index number

the position at which to remove values

minusLength number

the number of values to remove

plus Array

the values to add

Returns: Array

minus, the removed values from the content

unshift() → {boolean} source

Proxies unshifting content to the underlying collection, accounting for selectAddedContent.

Parameters:
Name Type Description
...values
Returns: boolean

whether the value was added

Generated from a4679af

comments powered by Disqus

More help?

Can't find what you are looking for? Get in touch, we're more than happy in helping answer your questions.