Constructor
new module:br/presenter/node/OptionsNodeList(vOptions)
OptionsNodeList instance.
Extends:
Parameters:
| Name | Type | Description |
|---|---|---|
vOptions |
Object | The set of available options, either as an array (keys only) or a map (keys to label). |
Extends
Methods
-
addChangeListener(oListener, sMethod, bNotifyImmediately)
-
Convenience method that allows listeners to be added for objects that do not themselves implement
module:br/presenter/node/NodeListListener.Listeners added using
addChangeListener()will only be notified whenmodule:br/presenter/node/NodeListListener#onNodeListChangedfires, and will not be notified if any of the othermodule:br/presenter/node/NodeListListenercall-backs fire. The advantage to using this method is that objects can choose to listen to call-back events on multiple node lists.Parameters:
Name Type Description oListenerObject The listener to be added. sMethodString The name of the method on the listener that will be invoked each time the property changes. bNotifyImmediatelyboolean (optional) Whether to invoke the listener immediately for the current value. - Inherited From:
- Source:
-
addListener(oListener, bNotifyImmediately)
-
Add a
module:br/presenter/node/NodeListListenerthat will be notified each time the node list is updated.Parameters:
Name Type Description oListenermodule:br/presenter/node/NodeListListener The listener to be added. bNotifyImmediatelyboolean Whether to invoke the listener immediately using the current node list. - Inherited From:
- Source:
-
getFirstOption() → {br.presenter.node.Option}
-
Retrieve the first option in the list — typically the default option.
Returns:
- Type
- br.presenter.node.Option
-
getOptionByLabel(sLabel)
-
Retrieve the option with the given label. (If there is more than one option which has the given label, the first instance is returned.)
Parameters:
Name Type Description sLabelString Label to search. Returns:
-
getOptionByValue(sValue, {@link)
-
Retrieve the option with the given unique value.
Parameters:
Name Type Description sValueString Value to search. {@linkmodule:br/presenter/node/Option} -
getOptionLabels() → {Array}
-
Retrieve an array of labels for each
module:br/presenter/node/Optioncontained within this object.Returns:
- Type
- Array
-
getOptions() → {Array}
-
Retrieve the array of
module:br/presenter/node/Optioninstances contained by this object.Returns:
- Type
- Array
-
getOptionValues() → {Array}
-
Retrieve an array of values for each
module:br/presenter/node/Optioncontained within this object.Returns:
- Type
- Array
-
getPath()
-
Returns the path that would be required to bind this node from the view.
This method is used internally, but might also be useful in allowing the dynamic construction of views for arbitrary presentation models.
-
getPresentationNodesArray()
-
Returns the list of
module:br/presenter/node/PresentationNodeinstances as an array. -
getTemplateForNode(oPresentationNode)
-
Returns the name of the template used to render the given presentation node.
Parameters:
Name Type Description oPresentationNodemodule:br/presenter/node/PresentationNode The presentation node being queried. - Inherited From:
- Source:
-
nodes(sNodeName, vProperties)
-
Returns all nested nodes matching the search criteria reachable from this node.
Care is taken not to search up the tree in cyclic presentation models (where some of the presentation nodes have back references to presentation nodes higher up in the tree).
Parameters:
Name Type Description sNodeNameString The name of nodes to match. vPropertiesObject Only nodes having this array or map of properties will be matched. - Inherited From:
- Source:
- See:
-
properties(sPropertyName, vValue)
-
Returns all nested properties matching the search criteria reachable from this node.
Care is taken not to search up the tree in cyclic presentation models (where some of the presentation nodes have back references to presentation nodes higher up in the tree).
Parameters:
Name Type Description sPropertyNameString The name of properties to match. vValueObject The value of properties to match. - Inherited From:
- Source:
- See:
-
removeAllListeners()
-
Remove all previously added
module:br/presenter/node/NodeListListenerinstances.- Inherited From:
- Source:
-
removeChildListeners()
-
Removes all listeners attached to the properties contained by this
PresentationNode, and any nodes it contains. -
removeListener(oListener)
-
Remove a previously added
module:br/presenter/node/NodeListListener.Parameters:
Name Type Description oListenermodule:br/presenter/node/NodeListListener The listener being removed. - Inherited From:
- Source:
-
setOptions(vOptions)
-
Reset the list of available options using the given array or map.
Parameters:
Name Type Description vOptionsObject The set of available options, either as an array (keys only) or a map (keys to label).