X
Namespaces

dojox/form/BusyButton.js

  • Provides:

    • dojox.form.BusyButton
  • Requires:

    • dijit.form.Button in common in project dijit
  • dojox.form._BusyButtonMixin

    • type
      Function
    • summary
  • dojox.form._BusyButtonMixin.isBusy

    • summary
  • dojox.form._BusyButtonMixin.busyLabel

    • summary
  • dojox.form._BusyButtonMixin.timeout

    • summary
  • dojox.form._BusyButtonMixin.useIcon

    • summary
  • dojox.form._BusyButtonMixin.postMixInProperties

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        if(!this.busyLabel){
         this.busyLabel = dojo.i18n.getLocalization("dijit", "loading", this.lang).loadingState;
        }
    • summary
  • dojox.form._BusyButtonMixin.postCreate

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        this._label = this.containerNode.innerHTML;
        this._initTimeout = this.timeout;

        
        // for initial busy buttons
        if(this.isBusy){
         this.makeBusy();
        }
    • summary
      stores initial label and timeout for reference
  • dojox.form._BusyButtonMixin.makeBusy

    • type
      Function
    • source: [view]
        this.isBusy = true;
        this.set("disabled", true);

         
        this.setLabel(this.busyLabel, this.timeout);
    • summary
      sets state from idle to busy
  • dojox.form._BusyButtonMixin.cancel

    • type
      Function
    • source: [view]
        this.set("disabled", false);
        this.isBusy = false;
        this.setLabel(this._label);
        if(this._timeout){ clearTimeout(this._timeout); }
        this.timeout = this._initTimeout;
    • summary
      if no timeout is set or for other reason the user can put the button back
      to being idle
  • dojox.form._BusyButtonMixin.resetTimeout

    • type
      Function
    • parameters:
      • timeout: (typeof Int)
    • source: [view]
        if(this._timeout){
         clearTimeout(this._timeout);
        }

        
        // new timeout
        if(timeout){
         this._timeout = setTimeout(dojo.hitch(this, function(){
          this.cancel();
         }), timeout);
        }else if(timeout == undefined || timeout === 0){
         this.cancel();
        }
    • summary
      to reset existing timeout and setting a new timeout
  • dojox.form._BusyButtonMixin.setLabel

    • type
      Function
    • parameters:
      • content: (typeof String)
      • timeout: (typeof Int)
    • source: [view]
        this.label = content;
        // remove children
        while (this.containerNode.firstChild){
         this.containerNode.removeChild(this.containerNode.firstChild);
        }
        this.containerNode.innerHTML = this.label;

        
        if(this.showLabel == false && !(dojo.attr(this.domNode, "title"))){
         this.titleNode.title=dojo.trim(this.containerNode.innerText || this.containerNode.textContent || '');
        }
        // End IE hack

        
        // setting timeout
        if(timeout){
         this.resetTimeout(timeout);
        }else{
         this.timeout = null;
        }

        
        // create optional busy image
        if(this.useIcon && this.isBusy){
         var node = new Image();
         node.src = this._blankGif;
         dojo.attr(node, "id", this.id+"_icon");
         dojo.addClass(node, "dojoxBusyButtonIcon");
         this.containerNode.appendChild(node);
        }
    • summary
      reset the label (text) of the button; takes an HTML string
  • dojox.form._BusyButtonMixin._clicked

    • type
      Function
    • parameters:
      • e: (typeof )
    • source: [view]
        if(!this.isBusy){
         this.makeBusy();
        }
    • summary
      on button click the button state gets changed
      
      only do something if button is not busy
  • dojox.form._BusyButtonMixin._label

    • summary
  • dojox.form._BusyButtonMixin._initTimeout

    • summary
  • dojox.form._BusyButtonMixin._timeout

    • summary
  • dojox.form._BusyButtonMixin.label

    • summary
  • dojox.form._BusyButtonMixin.containerNode.innerHTML

    • summary
  • dojox.form._BusyButtonMixin.showLabel

    • summary
  • dojox.form._BusyButtonMixin.titleNode.title

    • summary
  • dojox.form.BusyButton

    • type
      Function
    • chains:
      • dijit.form.Button: (prototype)
      • dijit.form.Button: (call)
      • dojox.form._BusyButtonMixin: (call)
    • mixins:
      • dojox.form._BusyButtonMixin.prototype: (prototype)
    • summary
  • dojox.form.BusyComboButton

    • type
      Function
    • chains:
      • dijit.form.ComboButton: (prototype)
      • dijit.form.ComboButton: (call)
      • dojox.form._BusyButtonMixin: (call)
    • mixins:
      • dojox.form._BusyButtonMixin.prototype: (prototype)
    • summary
  • dojox.form.BusyDropDownButton

    • type
      Function
    • chains:
      • dijit.form.DropDownButton: (prototype)
      • dijit.form.DropDownButton: (call)
      • dojox.form._BusyButtonMixin: (call)
    • mixins:
      • dojox.form._BusyButtonMixin.prototype: (prototype)
    • summary
  • dojox.form

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary