dijit/_Contained.js

  • Provides:

    • dijit._Contained
  • dijit._Contained

    • type
      Function
    • summary
      Mixin for widgets that are children of a container widget
    • example
      
       	// make a basic custom widget that knows about it's parents
      	dojo.declare("my.customClass",[dijit._Widget,dijit._Contained],{});
  • dijit._Contained.getParent

    • type
      Function
    • source: [view]
          var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
          return parent && parent.isContainer ? parent : null;
    • summary
      Returns the parent widget of this widget, assuming the parent
      specifies isContainer
  • dijit._Contained._getSibling

    • type
      Function
    • parameters:
      • which: (typeof String)
        Either "next" or "previous"
    • source: [view]
          var node = this.domNode;
          do{
           node = node[which+"Sibling"];
          }while(node && node.nodeType != 1);
          return node && dijit.byNode(node); // dijit._Widget
    • summary
      Returns next or previous sibling
    • tags:
    • returns
      dijit._Widget
  • dijit._Contained.getPreviousSibling

    • type
      Function
    • source: [view]
          return this._getSibling("previous"); // dijit._Widget
    • summary
      Returns null if this is the first child of the parent,
      otherwise returns the next element sibling to the "left".
    • returns
      dijit._Widget
  • dijit._Contained.getNextSibling

    • type
      Function
    • source: [view]
          return this._getSibling("next"); // dijit._Widget
    • summary
      Returns null if this is the last child of the parent,
      otherwise returns the next element sibling to the "right".
    • returns
      dijit._Widget
  • dijit._Contained.getIndexInParent

    • type
      Function
    • source: [view]
          var p = this.getParent();
          if(!p || !p.getIndexOfChild){
           return -1; // int
          }
          return p.getIndexOfChild(this); // int
    • summary
      Returns the index of this widget within its container parent.
      It returns -1 if the parent does not exist, or if the parent
      is not a dijit._Container
    • returns
      int
  • dijit

    • type
      Object
    • summary