Class: ConfigurableSelectionModel

ConfigurableSelectionModel()

The ConfigurableSelectionModel adds the logic to the SelectionModel to only have one item selected at a time via the `singleSelection` flag.

Constructor

new ConfigurableSelectionModel()

Source:

Extends

Members

_fireEvents

Properties:
Name Type Description
Flag Boolean that control the firing of action events: onSelect, onDeselect, onClear
Inherited From:
Source:

clearAsDeselect

Properties:
Name Type Description
Flag Boolean that determines how to clear: True: Deselect is called on every item, firing onDeselect for each and firing onClear at the end False: Collection is immediately wiped and only onClear is fired
Inherited From:
Source:

count

Properties:
Name Type Description
Number Number of selections
Inherited From:
Source:

requireSelection

Properties:
Name Type Description
Flag Boolean to indicate a selection is required.
Inherited From:
Source:

selections

Properties:
Name Type Description
Collection Object of selections where the key is the selections key
Inherited From:
Source:

singleSelection

Properties:
Name Type Description
Flag Boolean that controls if only one item is selectable at a time. Meaning if this is true then when a selection is made it first clears the store.
Source:

Methods

clear()

Removes all items from the store
Inherited From:
Source:

deselect(key)

Removes an item from the store
Parameters:
Name Type Description
key String Unique identifier string that was given when the item was added
Inherited From:
Source:

getSelectedKeys() → {Array.<String>}

Returns a list of unique identifier keys used in the selection collection
Inherited From:
Source:
Returns:
All keys in the store
Type
Array.<String>

getSelectionCount() → {Number}

Returns the number of items in the store
Inherited From:
Source:
Returns:
Current count of items
Type
Number

getSelections() → {Object}

Returns all items in the store
Inherited From:
Source:
Returns:
The entire selection collection
Type
Object

isSelected(key) → {Boolean}

Determines if the given key is in the selections collection.
Parameters:
Name Type Description
key String Unique identifier string that was given when the item was added
Inherited From:
Source:
Returns:
True if the item is in the store.
Type
Boolean

onClear(self)

Event that happens when the store is cleared
Parameters:
Name Type Description
self
Inherited From:
Source:

onDeselect(key, data, tag, self)

Event that happens when an item is deselected/removed.
Parameters:
Name Type Description
key String Unique identifier string
data Object The item removed
tag
self
Inherited From:
Source:

onSelect(key, data, tag, self)

Event that happens when an item is selected/added.
Parameters:
Name Type Description
key String Unique identifier string
data Object The item stored
tag
self
Inherited From:
Source:

resumeEvents()

Enables the firing of action events: onSelect, onDeselect, onClear
Inherited From:
Source:

select(key, data, tag)

Extends the base select by first clearing out the entire store if `singleSelection` is true and there are items already in the store.
Parameters:
Name Type Description
key String Unique identifier string
data Object The item being selected
tag
Overrides:
Source:

suspendEvents()

Prevents the firing of action events: onSelect, onDeselect, onClear
Inherited From:
Source:

toggle(key, data, tag)

Adds an item to the `selections` if it is not already stored, if it is stored, then it deselects (removes) the item.
Parameters:
Name Type Description
key String Unique identifier string
data Object The item being selected
tag
Inherited From:
Source:

useSingleSelection(val)

This function is called in Lists beforeTransitionTo and it is always passed the Lists navigation options `singleSelect`. It then sets the flag `singleSelection` to the value if the passed value.
Parameters:
Name Type Description
val Boolean The state that `singleSelection` should be in.
Source: