dojox/form/CheckedMultiSelect.js

  • Provides:

    • dojox.form.CheckedMultiSelect
  • Requires:

    • dijit.form.CheckBox in common in project dijit
    • dijit.Tooltip in common in project dijit
    • dijit.form._FormSelectWidget in common in project dijit
  • dojox.form._CheckedMultiSelectItem

    • type
      Function
    • chains:
      • dijit._Widget: (prototype)
      • dijit._Widget: (call)
      • dijit._Templated: (call)
    • mixins:
      • dijit._Templated.prototype: (prototype)
    • summary
      The individual items for a CheckedMultiSelect
  • dojox.form._CheckedMultiSelectItem.widgetsInTemplate

    • summary
  • dojox.form._CheckedMultiSelectItem.templateString

    • summary
  • dojox.form._CheckedMultiSelectItem.baseClass

    • summary
  • dojox.form._CheckedMultiSelectItem.option

    • type
      dojox.form.__SelectOption
    • summary
      The option that is associated with this item
  • dojox.form._CheckedMultiSelectItem.parent

    • summary
  • dojox.form._CheckedMultiSelectItem.disabled

    • type
      boolean
    • summary
      Whether or not this widget is disabled
  • dojox.form._CheckedMultiSelectItem.readOnly

    • type
      boolean
    • summary
      Whether or not this widget is readOnly
  • dojox.form._CheckedMultiSelectItem.postMixInProperties

    • type
      Function
    • source: [view]
        if(this.parent.multiple){
         this._type = {type: "checkbox", baseClass: "dijitCheckBox"};
        }else{
         this._type = {type: "radio", baseClass: "dijitRadio"};
        }
        this.disabled = this.option.disabled = this.option.disabled||false;
        this.inherited(arguments);
    • summary
      Set the appropriate _subClass value - based on if we are multi-
      or single-select
  • dojox.form._CheckedMultiSelectItem.postCreate

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        this.labelNode.innerHTML = this.option.label;
    • summary
      Set innerHTML here - since the template gets messed up sometimes
      with rich text
  • dojox.form._CheckedMultiSelectItem._changeBox

    • type
      Function
    • source: [view]
        if(this.get("disabled") || this.get("readOnly")){ return; }
        if(this.parent.multiple){
         this.option.selected = this.checkBox.get('value') && true;
        }else{
         this.parent.set('value', this.option.value);
        }
        // fire the parent's change
        this.parent._updateSelection();

        
        // refocus the parent
        this.parent.focus();
    • summary
      Called to force the select to match the state of the check box
      (only on click of the checkbox)	 Radio-based calls _setValueAttr
      instead.
  • dojox.form._CheckedMultiSelectItem._onClick

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(this.get("disabled") || this.get("readOnly")){
         dojo.stopEvent(e);
        }else{
         this.checkBox._onClick(e);
        }
    • summary
      Sets the click state (passes through to the check box)
  • dojox.form._CheckedMultiSelectItem._updateBox

    • type
      Function
    • source: [view]
        this.checkBox.set('value', this.option.selected);
    • summary
      Called to force the box to match the state of the select
  • dojox.form._CheckedMultiSelectItem._setDisabledAttr

    • type
      Function
    • parameters:
      • value: (typeof )
    • source: [view]
        this.disabled = value||this.option.disabled;
        this.checkBox.set("disabled", this.disabled);
        dojo.toggleClass(this.domNode, "dojoxMultiSelectDisabled", this.disabled);
    • summary
      Disables (or enables) all the children as well
  • dojox.form._CheckedMultiSelectItem._setReadOnlyAttr

    • type
      Function
    • parameters:
      • value: (typeof )
    • source: [view]
        this.checkBox.set("readOnly", value);
        this.readOnly = value;
    • summary
      Sets read only (or unsets) all the children as well
  • dojox.form._CheckedMultiSelectItem._type

    • summary
  • dojox.form._CheckedMultiSelectItem.labelNode.innerHTML

    • summary
  • dojox.form._CheckedMultiSelectItem.option.selected

    • summary
  • dojox.form.CheckedMultiSelect

    • type
      Function
    • chains:
      • dijit.form._FormSelectWidget: (prototype)
      • dijit.form._FormSelectWidget: (call)
    • summary
      Extends the core dijit MultiSelect to provide a "checkbox" selector
  • dojox.form.CheckedMultiSelect.templateString

    • summary
  • dojox.form.CheckedMultiSelect.baseClass

    • summary
  • dojox.form.CheckedMultiSelect.required

    • type
      Boolean
    • summary
      User is required to check at least one item.
  • dojox.form.CheckedMultiSelect.invalidMessage

    • type
      String
    • summary
      The message to display if value is invalid.
  • dojox.form.CheckedMultiSelect._message

    • type
      String
    • summary
      Currently displayed message
  • dojox.form.CheckedMultiSelect.tooltipPosition

    • type
      String[
    • summary
      See description of `dijit.Tooltip.defaultPosition` for details on this parameter.
  • dojox.form.CheckedMultiSelect._onMouseDown

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        dojo.stopEvent(e);
    • summary
      Cancels the mousedown event to prevent others from stealing
      focus
  • dojox.form.CheckedMultiSelect.validator

    • type
      Function
    • source: [view]
        if (!this.required){ return true; }
        return dojo.some(this.getOptions(), function(opt){
         return opt.selected && opt.value != null && opt.value.toString().length != 0;
        });
    • summary
      Overridable function used to validate that an item is selected if required =
      true.
    • tags:
  • dojox.form.CheckedMultiSelect.validate

    • type
      Function
    • parameters:
      • isFocused: (typeof )
    • source: [view]
        dijit.hideTooltip(this.domNode);
        var isValid = this.isValid(isFocused);
        if(!isValid){ this.displayMessage(this.invalidMessage); }
        return isValid;
    • summary
  • dojox.form.CheckedMultiSelect.isValid

    • type
      Function
    • parameters:
      • isFocused: (typeof Boolean)
    • source: [view]
        return this.validator();
    • summary
      Tests if the required items are selected.
      Can override with your own routine in a subclass.
    • tags:
  • dojox.form.CheckedMultiSelect.getErrorMessage

    • type
      Function
    • parameters:
      • isFocused: (typeof Boolean)
    • source: [view]
        return this.invalidMessage;
    • summary
      Return an error message to show if appropriate
    • tags:
  • dojox.form.CheckedMultiSelect.displayMessage

    • type
      Function
    • parameters:
      • message: (typeof String)
    • source: [view]
        dijit.hideTooltip(this.domNode);
        if(message){
         dijit.showTooltip(message, this.domNode, this.tooltipPosition);
        }
    • summary
      Overridable method to display validation errors/hints.
      By default uses a tooltip.
    • tags:
  • dojox.form.CheckedMultiSelect.onAfterAddOptionItem

    • type
      Function
    • parameters:
      • item: (typeof )
      • option: (typeof )
    • source: [view]
        // summary:
        //  a function that can be connected to in order to receive a
        //  notification that an item as been added to this dijit.
    • summary
      a function that can be connected to in order to receive a
      notification that an item as been added to this dijit.
  • dojox.form.CheckedMultiSelect._addOptionItem

    • type
      Function
    • parameters:
      • option: (typeof dojox.form.__SelectOption)
    • source: [view]
        var item = new dojox.form._CheckedMultiSelectItem({
         option: option,
         parent: this
        });
        this.wrapperDiv.appendChild(item.domNode);
        this.onAfterAddOptionItem(item, option);
    • summary
  • dojox.form.CheckedMultiSelect._refreshState

    • type
      Function
    • source: [view]
        this.validate(this._focused);
    • summary
      Validate if selection changes.
  • dojox.form.CheckedMultiSelect.onChange

    • type
      Function
    • parameters:
      • newValue: (typeof )
    • source: [view]
        this._refreshState();
    • summary
      Validate if selection changes.
  • dojox.form.CheckedMultiSelect.reset

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        dijit.hideTooltip(this.domNode);
    • summary
      Overridden so that the state will be cleared.
  • dojox.form.CheckedMultiSelect._updateSelection

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        this._handleOnChange(this.value);
        dojo.forEach(this._getChildren(), function(c){ c._updateBox(); });
    • summary
  • dojox.form.CheckedMultiSelect._getChildren

    • type
      Function
    • source: [view]
        return dojo.map(this.wrapperDiv.childNodes, function(n){
         return dijit.byNode(n);
        });
    • summary
  • dojox.form.CheckedMultiSelect.invertSelection

    • type
      Function
    • parameters:
      • onChange: (typeof Boolean)
        If null, onChange is not fired.
    • source: [view]
        dojo.forEach(this.options, function(i){
         i.selected = !i.selected;
        });
        this._updateSelection();
    • summary
      Invert the selection
  • dojox.form.CheckedMultiSelect._setDisabledAttr

    • type
      Function
    • parameters:
      • value: (typeof )
    • source: [view]
        this.inherited(arguments);
        dojo.forEach(this._getChildren(), function(node){
         if(node && node.set){
          node.set("disabled", value);
         }
        });
    • summary
      Disable (or enable) all the children as well
  • dojox.form.CheckedMultiSelect._setReadOnlyAttr

    • type
      Function
    • parameters:
      • value: (typeof )
    • source: [view]
        if("readOnly" in this.attributeMap){
         this._attrToDom("readOnly", value);
        }
        this.readOnly = value;
        dojo.forEach(this._getChildren(), function(node){
         if(node && node.set){
          node.set("readOnly", value);
         }
        });
    • summary
      Sets read only (or unsets) all the children as well
  • dojox.form.CheckedMultiSelect.uninitialize

    • type
      Function
    • source: [view]
        dijit.hideTooltip(this.domNode);
        // Make sure these children are destroyed
        dojo.forEach(this._getChildren(), function(child){
         child.destroyRecursive();
        });
        this.inherited(arguments);
    • summary
  • dojox.form.CheckedMultiSelect.readOnly

    • summary
  • dojox.form

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary