dojox/widget/DynamicTooltip.js

  • Provides:

    • dojox.widget.DynamicTooltip
  • Requires:

    • dijit.Tooltip in common in project dijit
  • dojox.widget.DynamicTooltip

    • type
      Function
    • chains:
      • dijit.Tooltip: (prototype)
      • dijit.Tooltip: (call)
    • summary
      Extention of dijit.Tooltip providing content set via XHR
      request via href param
  • dojox.widget.DynamicTooltip.hasLoaded

    • type
      Boolean
    • summary
      false if the contents are yet to be loaded from the HTTP request
  • dojox.widget.DynamicTooltip.href

    • type
      String
    • summary
      location from where to fetch the contents
  • dojox.widget.DynamicTooltip.label

    • type
      String
    • summary
      contents to diplay in the tooltip. Initialized to a loading icon.
  • dojox.widget.DynamicTooltip.preventCache

    • type
      Boolean
    • summary
      Cache content retreived externally
  • dojox.widget.DynamicTooltip.postMixInProperties

    • type
      Function
    • source: [view]
         this.inherited(arguments);
         this._setLoadingLabel();
    • summary
  • dojox.widget.DynamicTooltip._setLoadingLabel

    • type
      Function
    • source: [view]
         if(this.href){
          this.label = dojo.i18n.getLocalization("dijit", "loading", this.lang).loadingState;
         }
    • summary
      Changes the tooltip label / contents to loading message, only if
      there's an href param, otherwise acts as normal tooltip
  • dojox.widget.DynamicTooltip._setHrefAttr

    • type
      Function
    • parameters:
      • href: (typeof String|Uri)
        url to the content you want to show, must be within the same domain as your mainpage
    • source: [view]
         this.href = href;
         this.hasLoaded = false;
    • summary
      Hook so attr("href", ...) works.
    • description
      resets so next show loads new href
  • dojox.widget.DynamicTooltip.loadContent

    • type
      Function
    • parameters:
      • node: (typeof )
    • source: [view]
         if(!this.hasLoaded && this.href){
          this._setLoadingLabel();
          this.hasLoaded = true;

          
          dojo.xhrGet({
           url: this.href,
           handleAs: "text",
           tooltipWidget: this,
           load: function(response, ioArgs){
            this.tooltipWidget.label = response;
            this.tooltipWidget.close();
            this.tooltipWidget.open(node);
           },
           preventCache: this.preventCache
          });
         }
    • summary
      Download contents of href via XHR and display
    • description
      1. checks if content already loaded
      2. if not, sends XHR to download new data
  • dojox.widget.DynamicTooltip.refresh

    • type
      Function
    • source: [view]
         this.hasLoaded = false;
    • summary
      Allows re-download of contents of href and display
      Useful with preventCache = true
  • dojox.widget.DynamicTooltip.open

    • type
      Function
    • parameters:
      • target: (typeof DomNode)
    • source: [view]
         target = target || (this._connectNodes && this._connectNodes[0]);
         if(!target){ return; }


         this.loadContent(target);
         this.inherited(arguments);
    • summary
      Display the tooltip; usually not called directly.
  • dojox.widget.DynamicTooltip._setHrefAttr.href

    • type
      url
    • summary
      to the content you want to show, must be within the same domain as your mainpage
  • dojox.widget.DynamicTooltip.tooltipWidget.label

    • summary
  • dojox.widget

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary