The "Add All" button click handler.
Adds all of the "Available" options to the "selected" Options, checking to avoid duplicates.
This method checks if the Widget is a "stack", if so, it moves the Option from left to right.
Parameters:
e,EventHandle
The button's Eventhandle from the button .on "click" event
The "Remove All" button click handler.
Removes all of the option(s) from the "Selections" right-side options. This method checks if the
Widget is a "stack", if so, it moves the Option from right to left, otherwise it destroys it.
Parameters:
e,EventHandle
The button's Eventhandle from the button .on "click" event
The "Remove One" button click handler.
Removes the DOM selected option(s) from the "Selections" right-side options. This method checks if the
Widget is a "stack", if so, it moves the Option from right to left, otherwise it destroys it.
Parameters:
e,EventHandle
The button's Eventhandle from the button .on "click" event
Internal method to normalize the 'text', 'value', and 'title' data based upon the input
"optionsMap" of the "options" attribute. Returns an object that can be used directly by
the JS new Option( text, value ) command.
Returns:
Object:
An object that contains { value, text, title } for defining the JS Option
Internal method intended to return the provided opt_node object back to the "options"
SELECT OPTION in the original defined order.
This would only be used for "stackMode" and "preserveOrder" true.
Utility function to avoid duplicate adding an option to the right-hand side "selections" Options element.
This method checks if the "opt_node" already exists in the "selections" Options, if so it returns TRUE,
if not it returns FALSE.
Parameters:
opt_node,Node
The Option node to check for existence.
Returns:
true or false, If the opt_node already exists in the Options array
Attribute allows specifying the "button" type to be used during construction of the
Widget template. Currently supported are HTML , a Y.Button object, a Y.Button
CSSButton, and a simple HTML link.
Recognized settings are 'htmlbutton', 'ybutton', 'cssbutton', 'link'
The Array to populate the SELECT / OPTIONS on the left-side, herein referred to
as "options" in this widget.
Elements of this array aren't required to have members { text:'', value:''},
if the members are different they can be mapped to the expected settings using
the "optionsMap" attribute.
If the members of this array are non-object single-items, they are assumed to be
the "text" item, and the "value" will also be set to this item.
An object having members "value, text, title" that defines the mapping
between the provided "options" array data and the expected parameters of
the JavaScript <option> (value, text title).
A flag setting for preserving the original order of the options, when add or
remove actions are taken. With "preserveOrder" false, all items are added to the
bottom of the left / right side HTML SELECT / OPTIONS. If set to TRUE, the
options are returned to proper order from the original "options" setting.
This only has relevance when "stackMode" is TRUE.
The Array to populate the SELECT / OPTIONS on the right-side, herein referred
to as "selected" in this widget. For example, if a FORM is opened with default
multi-selected items, they would be provided in this attribute as an array.
Elements of this array aren't required to have members { text:'', value:''},
if the members are different they can be mapped to the expected settings using
the "optionsMap" attribute.
If the members of this array are non-object single-items, they are assumed to be
the "text" item, and the "value" will also be set to this item.
A flag setting for enabling "stack" mode of this widget. In "stack" mode
the JS Options are moved from left-to-right individually, so that they can't
be re-used inadvertantly.
For example, "Add One" from the left option MOVES the option to the right-side
"selections". If "Remove One" is chosen, the right-side selected item is returned
to the bottom of the left-hand side options. (Can't currently return it to the
index of where it came from ... see "preserveOrder").
The DOM ID element of the "template" to be used for defining the OPTIONS, SELECTIONS,
and the BUTTONS.
Expected replacable placeholder tokens positioned within the "template" are identified as;
{OPTIONS_CONTAINER} : Left-hand side "Options" <select> placeholder
{SELECTIONS_CONTAINER} : Right-hand side "Selected" <select> placeholder
{ACTION_ALL} : Placeholder for the "Add All" button
{ACTION_ONE} : Placeholder for the "Add One" button
{ACTION_BACK} : Placeholder for the "Remove One" button
{ACTION_ALLBACK} : Placeholder for the "Remove All" button