dojo.provide("dijit.form.MultiSelect");
dojo.require("dijit.form._FormWidget");
dojo.declare("dijit.form.MultiSelect",dijit.form._FormWidget,{
// summary: Wrapper for a native select multiple="true" element to
// interact with dijit.form.Form
// size: Number
// Number of elements to display on a page
// NOTE: may be removed in version 2.0, since elements may have variable height;
// set the size via style="..." or CSS class names instead.
size: 7,
templateString: "",
attributeMap: dojo.mixin(dojo.clone(dijit.form._FormWidget.prototype.attributeMap),
{size:"focusNode"}),
reset: function(){
// TODO: once we inherit from FormValueWidget this won't be needed
this._hasBeenBlurred = false;
this._setValueAttr(this._resetValue, true);
},
addSelected: function(/* dijit.form.MultiSelect */select){
// summary: Move the selected nodes af an passed Select widget
// instance to this Select widget.
//
// example:
// | // move all the selected values from "bar" to "foo"
// | dijit.byId("foo").addSelected(dijit.byId("bar"));
select.getSelected().forEach(function(n){
this.containerNode.appendChild(n);
if(dojo.isIE){ // tweak the node to force IE to refresh (aka _layoutHack on FF2)
var s = dojo.getComputedStyle(n);
if(s){
var filter = s.filter;
n.style.filter = "alpha(opacity=99)";
n.style.filter = filter;
}
}
// scroll to bottom to see item
// cannot use scrollIntoView since