new SortedItem(manager, index, value)
Parameters:
| Name | Type | Description |
|---|---|---|
manager |
olympe.dc.ranking.SortedManager | |
index |
string | |
value |
T |
Extends
Members
-
<nullable> activeChild :olympe.dc.ranking.Deferred
-
Type:
-
activeChildSet :boolean
-
Type:
- boolean
-
<protected, nullable> child :olympe.dc.ranking.Deferred
-
Type:
- Inherited From:
- Overrides:
-
<protected> depth :number
-
Type:
- number
- Inherited From:
- Overrides:
-
index :string
-
Type:
- string
-
<protected> manager :olympe.dc.ranking.Manager
-
Type:
- Inherited From:
- Overrides:
-
<nullable> node :olympe.df.Node
-
Type:
-
<protected, nullable> parent :olympe.dc.ranking.Deferred
-
Type:
- Inherited From:
- Overrides:
-
<nullable> position :number
-
Type:
- number
-
sortValue :T
-
Type:
- T
-
value :T
-
Type:
- T
Methods
-
activate()
-
Activates the parent deferred and update ranks. That is, ask the ranking manager to compute ranks for the parent depth
- Inherited From:
- Overrides:
Throws:
-
If the deferred doesn't have a parent
- Type
- Error
-
collectItems(siblings)
-
Adds the items registered in this deferred to the specified array
Parameters:
Name Type Description siblingsArray.<string> Array of item's indexes
- Inherited From:
- Overrides:
-
destroy()
-
Destroy the item
-
getChild(added, tag, index)
-
Get the child deferred for this item, representing a new depth level in the transformer chain.
The child is common to all the items at the same depth. This method could be refactored to handle separately getting the child and managing the items at the given level.
Parameters:
Name Type Description addedboolean Whether the item is added or removed
tagstring Item's tag
indexstring Item's index
- Inherited From:
- Overrides:
Returns:
-
getCurrentValue()
-
Gets the current value of the sorted item
Returns:
- Type
- T
-
getDepth()
-
Gets the depth of this
- Inherited From:
- Overrides:
Returns:
- Type
- number
-
getDescendant(depth)
-
Gets the grand child at the specified depth, or the deepest available child if the transform chain was stopped by a filter
Parameters:
Name Type Description depthnumber Descendant depth (if depth is 0, this deferred is returned)
- Inherited From:
- Overrides:
Returns:
-
getManager()
-
Gets the parent ranking manager
- Inherited From:
- Overrides:
Returns:
-
getSortValue()
-
Gets the value used to sort the item
Returns:
- Type
- T
-
isDestroyed()
-
Returns:
- Type
- boolean
-
onNewValue(callback)
-
Executes the callback only when the value change compare to the current
Parameters:
Name Type Description callbackfunction -
onValueResolved(callback)
-
Parameters:
Name Type Description callbackfunction -
setActiveChild(depth)
-
Parameters:
Name Type Description depthnumber -
updateSortValue()
-
Set the sort value to be equal to the current value
Olympe SDK