dojox/form/manager/_EnableMixin.js

  • Provides:

    • dojox.form.manager._EnableMixin
  • Requires:

    • dojox.form.manager._Mixin in common
  • dojox.form.manager._EnableMixin

    • type
      Function
    • summary
      Form manager's mixin for controlling enable/disable state of
      form elements.
    • description
      This mixin provides unified enable/disable functionality for
      form widgets and form elements. It should be used together
      with dojox.form.manager.Mixin.
  • dojox.form.manager._EnableMixin.gatherEnableState

    • type
      Function
    • parameters:
      • names: (typeof Object)
        If it is an array, it is a list of names to be processed.
        If it is an object, dictionary keys are names to be processed.
        If it is omitted, all known form elements are to be processed.
    • source: [view]
         var result = this.inspectFormWidgets(ia(function(name, widget){
          return !widget.get("disabled");
         }), names);


         if(this.inspectFormNodes){
          dojo.mixin(result, this.inspectFormNodes(ia(function(name, node){
           return !dojo.attr(node, "disabled");
          }), names));
         }


         return result; // Object
    • summary
      Gather enable state of all form elements and return as a dictionary.
    • returns
      Object
  • dojox.form.manager._EnableMixin.enable

    • type
      Function
    • parameters:
      • state: (typeof Object)
        Optional. If a name-value dictionary, the value is true
        to enable and false to disable. If an array, all names in the
        array will be set to defaultState. If omitted, all form
        elements will be set to defaultState.
      • defaultState: (typeof Boolean)
        The default state (true, if omitted).
    • source: [view]
         if(arguments.length < 2 || defaultState === undefined){
          defaultState = true;
         }


         this.inspectFormWidgets(aa(function(name, widget, value){
          widget.set("disabled", !value);
         }), state, defaultState);


         if(this.inspectFormNodes){
          this.inspectFormNodes(aa(function(name, node, value){
           dojo.attr(node, "disabled", !value);
          }), state, defaultState);
         }


         return this; // self
    • summary
      Enable form controls according to the supplied state object.
    • returns
      self
  • dojox.form.manager._EnableMixin.disable

    • type
      Function
    • parameters:
      • state: (typeof Object)
        Optional. If a name-value dictionary, the value is true
        to enable and false to disable. If an array, all names in the
        array will be disabled. If omitted, disables all.
    • source: [view]
         var oldState = this.gatherEnableState();
         this.enable(state, false);
         return oldState; // Object
    • summary
      Disable form controls according to the supplied state object
      returning the previous state.
    • returns
      Object
  • aa

    • summary
  • ia

    • summary
  • dojox.form.manager

    • type
      Object
    • summary
  • dojox.form

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary