Functiondijit.form.MultiSelect.addSelected

dojo.require("dijit.form.MultiSelect");
defined in dijit/form/MultiSelect.js

Move the selected nodes af an passed Select widget instance to this Select widget.

Usage

function (/*dijit.form.MultiSelect*/ select) (view source)
parametertypedescription
selectdijit.form.MultiSelectWrapper for a native select multiple="true" element to interact with dijit.form.Form
fieldtypedescription
.addSelectedFunctionMove the selected nodes af an passed Select widget instance to this Select widget.
.altStringCorresponds to the native HTML <input> element's attribute.
.attributeMap 
.baseClass 
.buildRenderingFunctionConstruct the UI for this widget from a template, setting this.domNode.
.classStringHTML class attribute
.closable 
.connectFunctionConnects specified obj/event to specified method of this object and registers for disconnect() on widget destroy. Special event: "ondijitclick" triggers on a click or enter-down or space-up Similar to dojo.connect() but takes three arguments rather than four.
.containerNodeDomNodeholds child elements. "containerNode" is generally set via a dojoAttachPoint assignment and it designates where children of the src dom node will be placed
.createFunction 
.destroyFunction 
.destroyDescendantsFunctionRecursively destroy the children of this widget and their descendants.
.destroyRecursiveFunctionDestroy this widget and it's descendants. This is the generic "destructor" function that all widget users should call to cleanly discard with a widget. Once a widget is destroyed, it's removed from the manager object.
.destroyRenderingFunctionDestroys the DOM nodes associated with this widget
.dirStringUnsupported by Dijit, but here for completeness. Dijit only supports setting text direction on the entire document. Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir) attribute. Either left-to-right "ltr" or right-to-left "rtl".
.disabledBooleanShould this widget respond to user input? In markup, this is specified as "disabled='disabled'", or just "disabled".
.disconnectFunctionDisconnects handle created by this.connect. Also removes handle from this widget's list of connects
.dojoAttachEvent 
.dojoAttachPoint 
.domNode 
.focusFunction 
.getDescendantsFunctionReturns all the widgets that contained by this, i.e., all widgets underneath this.containerNode.
.getSelectedFunctionAccess the NodeList of the selected options directly
.getValueFunctionReturns an array of the selected options' values
.idStringa unique, opaque ID string that can be assigned by users or by the system. If the developer passes an ID which is known not to be unique, the specified ID is ignored and the system-generated ID is used instead.
.intermediateChangesBooleanFires onChange for each value change or only on demand
.invertSelectionFunctionInvert the selection
.isFocusableFunction 
.isLeftToRightFunctionChecks the DOM to for the text direction for bi-directional support
.langStringRarely used. Overrides the default Dojo locale used to render this widget, as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute. Value must be among the list of locales specified during by the Dojo bootstrap, formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
.layoutAlign 
.maxSize 
.minSize 
.nameStringName used when submitting form; same as "name" attribute or plain HTML elements
.nodesWithKeyClick 
.onBlurFunctionstub function. Override or connect to this method to receive notifications for when the widget moves out of focus.
.onChangeFunctioncallback when value is changed
.onCloseFunctionCallback if someone tries to close the child, child will be closed if func returns true
.onFocusFunctionstub function. Override or connect to this method to receive notifications for when the widget moves into focus.
.params 
.postCreateFunction 
.postMixInPropertiesFunctionCalled after the parameters to the widget have been read-in, but before the widget template is instantiated. Especially useful to set properties that are referenced in the widget template.
.postscriptFunction 
.readOnlyBooleanShould this widget respond to user input? In markup, this is specified as "readOnly". Similar to disabled except readOnly form values are submitted
.region 
.resetFunction 
.resizeFunction 
.selected 
.setAttributeFunction 
.setDisabledFunctionSet disabled state of widget (Deprecated).
.setValueFunctionSet the value(s) of this Select based on passed values
.size 
.sizeMin 
.sizeShare 
.splitter 
.srcNodeRefDomNodepointer to original dom node
.srcNodeRef.id 
.startupFunctionCalled after a widget's children, and other widgets on the page, have been created. Provides an opportunity to manipulate any children before they are displayed. This is useful for composite widgets that need to control or layout sub-widgets. Many layout widgets can use this as a wiring phase.
.stateModifier 
.staticClass 
.styleStringHTML style attribute
.tabIndexIntegerOrder fields are traversed when user hits the tab key
.templateNodeDomNodea node that represents the widget template. Pre-empts both templateString and templatePath.
.templatePathStringPath to template (HTML file) for this widget relative to dojo.baseUrl
.templateString 
.title 
.toStringFunction 
.typeStringCorresponds to the native HTML <input> element's attribute.
.uninitializeFunctionstub function. Override to implement custom widget tear-down behavior.
.valueStringCorresponds to the native HTML <input> element's attribute.
.waiRole 
.waiState 
.widgetsInTemplateBooleanshould we parse the template to find widgets that might be declared in markup inside it? false by default.
._active 
._attaches 
._attachTemplateNodesFunctionIterate through the template and attach functions and nodes accordingly.
._connects 
._fillContentFunctionrelocate source contents to templated container node this.containerNode must be able to receive children, or exceptions will be thrown
._getValueDeprecated 
._handleOnChangeFunctionset the value of the widget.
._hasBeenBlurred 
._hovering 
._lastValue 
._lastValueReported 
._layoutHackFunctionwork around table sizing bugs on FF2 by forcing redraw
._layoutHackHandle 
._ltr 
._mouseDown 
._multiValue 
._onBlurFunction 
._onChangeFunction 
._onChangeActive 
._onChangeMonitor 
._onFocusFunction 
._onMouseFunctionSets _hovering, _active, and stateModifier properties depending on mouse state, then calls setStateClass() to set appropriate CSS classes for this.domNode. To get a different CSS class for hover, send onmouseover and onmouseout events to this method. To get a different CSS class while mouse button is depressed, send onmousedown to this method.
._resetValue 
._setStateClassFunctionUpdate the visual state of the widget by setting the css classes on this.domNode (or this.stateNode if defined) by combining this.baseClass with various suffixes that represent the current widget state(s). In the case where a widget has multiple states, it sets the class based on all possible combinations. For example, an invalid form widget that is being hovered will be "dijitInput dijitInputInvalid dijitInputHover dijitInputInvalidHover". For complex widgets with multiple regions, there can be various hover/active states, such as "Hover" or "CloseButtonHover" (for tab buttons). This is controlled by a stateModifier="CloseButton" attribute on the close button node. The widget may have one or more of the following states, determined by this.state, this.checked, this.valid, and this.selected: Error - ValidationTextBox sets this.state to "Error" if the current input value is invalid Checked - ex: a checkmark or a ToggleButton in a checked state, will have this.checked==true Selected - ex: currently selected tab will have this.selected==true In addition, it may have one or more of the following states, based on this.disabled and flags set in _onMouse (this._active, this._hovering, this._focused): Disabled - if the widget is disabled Active - if the mouse (or space/enter key?) is being pressed down Focused - if the widget has focus Hover - if the mouse is over the widget
._skipNodeCache 
._started 
._stringReplFunction 
._supportingWidgets 

Examples

Example 1

// move all the selected values from "bar" to "foo"
dijit.byId("foo").addSelected(dijit.byId("bar"));