Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215

dojo/NodeList-traverse.js

  • Provides:

    • dojo.NodeList-traverse
  • dojo.NodeList

    • type
      Function
  • dojo.NodeList._buildArrayFromCallback

    • parameters:
      • callback: (typeof Function)
    • summary
      builds a new array of possibly differing size based on the input list.
      Since the returned array is likely of different size than the input array,
      the array's map function cannot be used.
    • type
      Function
  • dojo.NodeList._getUniqueAsNodeList

    • parameters:
      • nodes
    • returns
      dojo.NodeList
    • summary
      given a list of nodes, make sure only unique
      elements are returned as our NodeList object.
      Does not call _stash().
    • type
      Function
  • dojo.NodeList._getUniqueNodeListWithParent

    • parameters:
      • nodes
      • query
    • returns
      dojo.NodeList
    • summary
      gets unique element nodes, filters them further
      with an optional query and then calls _stash to track parent NodeList.
    • type
      Function
  • dojo.NodeList._getRelatedUniqueNodes

    • parameters:
      • query: (typeof String)
      • callback: (typeof Function)
    • returns
      dojo.NodeList
    • summary
      cycles over all the nodes and calls a callback
      to collect nodes for a possible inclusion in a result.
      The callback will get two args: callback(node, ary),
      where ary is the array being used to collect the nodes.
    • type
      Function
  • dojo.NodeList.children

    • parameters:
      • query: (typeof String)
        a CSS selector.
    • summary
      Returns all immediate child elements for nodes in this dojo.NodeList.
      Optionally takes a query to filter the child elements.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, all immediate child elements for the nodes in this dojo.NodeList.
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		Some Text
      		<div class="blue">Blue One</div>
      		<div class="red">Red Two</div>
      		<div class="blue">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".container").children();
      returns the four divs that are children of the container div.
      Running this code:
      	dojo.query(".container").children(".red");
      returns the two divs that have the class "red".
    • type
      Function
  • dojo.NodeList.closest

    • parameters:
      • query: (typeof String)
        a CSS selector.
      • root: (typeof String|DOMNode)
        If specified, query is relative to &quot;root&quot; rather than document body.
    • returns
      To make rhino strict checking happy.
    • summary
      Returns closest parent that matches query, including current node in this
      dojo.NodeList if it matches the query.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, the closest parent that matches the query, including the current
      node in this dojo.NodeList if it matches the query.
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		Some Text
      		<div class="blue">Blue One</div>
      		<div class="red">Red Two</div>
      		<div class="blue">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".red").closest(".container");
      returns the div with class "container".
    • type
      Function
  • dojo.NodeList.parent

    • parameters:
      • query: (typeof String)
        a CSS selector.
    • summary
      Returns immediate parent elements for nodes in this dojo.NodeList.
      Optionally takes a query to filter the parent elements.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, immediate parent elements for nodes in this dojo.NodeList.
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		<div class="blue first"><span class="text">Blue One</span></div>
      		<div class="red">Red Two</div>
      		<div class="blue"><span class="text">Blue Two</span></div>
      	</div>
      Running this code:
      	dojo.query(".text").parent();
      returns the two divs with class "blue".
      Running this code:
      	dojo.query(".text").parent(".first");
      returns the one div with class "blue" and "first".
    • type
      Function
  • dojo.NodeList.parents

    • parameters:
      • query: (typeof String)
        a CSS selector.
    • summary
      Returns all parent elements for nodes in this dojo.NodeList.
      Optionally takes a query to filter the child elements.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, all parent elements for nodes in this dojo.NodeList.
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		<div class="blue first"><span class="text">Blue One</span></div>
      		<div class="red">Red Two</div>
      		<div class="blue"><span class="text">Blue Two</span></div>
      	</div>
      Running this code:
      	dojo.query(".text").parents();
      returns the two divs with class "blue", the div with class "container",
      	the body element and the html element.
      Running this code:
      	dojo.query(".text").parents(".container");
      returns the one div with class "container".
    • type
      Function
  • dojo.NodeList.siblings

    • parameters:
      • query: (typeof String)
        a CSS selector.
    • summary
      Returns all sibling elements for nodes in this dojo.NodeList.
      Optionally takes a query to filter the sibling elements.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, all sibling elements for nodes in this dojo.NodeList.
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		Some Text
      		<div class="blue first">Blue One</div>
      		<div class="red">Red Two</div>
      		<div class="blue">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".first").siblings();
      returns the two divs with class "red" and the other div
      	with class "blue" that does not have "first".
      Running this code:
      	dojo.query(".first").siblings(".red");
      returns the two div with class "red".
    • type
      Function
  • dojo.NodeList.next

    • parameters:
      • query: (typeof String)
        a CSS selector.
    • summary
      Returns the next element for nodes in this dojo.NodeList.
      Optionally takes a query to filter the next elements.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, the next element for nodes in this dojo.NodeList.
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		Some Text
      		<div class="blue first">Blue One</div>
      		<div class="red">Red Two</div>
      		<div class="blue last">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".first").next();
      returns the div with class "red" and has innerHTML of "Red Two".
      Running this code:
      	dojo.query(".last").next(".red");
      does not return any elements.
    • type
      Function
  • dojo.NodeList.nextAll

    • parameters:
      • query: (typeof String)
        a CSS selector.
    • summary
      Returns all sibling elements that come after the nodes in this dojo.NodeList.
      Optionally takes a query to filter the sibling elements.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, all sibling elements that come after the nodes in this dojo.NodeList.
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		Some Text
      		<div class="blue first">Blue One</div>
      		<div class="red next">Red Two</div>
      		<div class="blue next">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".first").nextAll();
      returns the two divs with class of "next".
      Running this code:
      	dojo.query(".first").nextAll(".red");
      returns the one div with class "red" and innerHTML "Red Two".
    • type
      Function
  • dojo.NodeList.prev

    • parameters:
      • query: (typeof String)
        a CSS selector.
    • summary
      Returns the previous element for nodes in this dojo.NodeList.
      Optionally takes a query to filter the previous elements.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, the previous element for nodes in this dojo.NodeList.
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		Some Text
      		<div class="blue first">Blue One</div>
      		<div class="red">Red Two</div>
      		<div class="blue">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".first").prev();
      returns the div with class "red" and has innerHTML of "Red One".
      Running this code:
      	dojo.query(".first").prev(".blue");
      does not return any elements.
    • type
      Function
  • dojo.NodeList.prevAll

    • parameters:
      • query: (typeof String)
        a CSS selector.
    • summary
      Returns all sibling elements that come before the nodes in this dojo.NodeList.
      Optionally takes a query to filter the sibling elements.
    • description
      The returned nodes will be in reverse DOM order -- the first node in the list will
      be the node closest to the original node/NodeList.
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, all sibling elements that come before the nodes in this dojo.NodeList.
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red prev">Red One</div>
      		Some Text
      		<div class="blue prev">Blue One</div>
      		<div class="red second">Red Two</div>
      		<div class="blue">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".second").prevAll();
      returns the two divs with class of "prev".
      Running this code:
      	dojo.query(".first").prevAll(".red");
      returns the one div with class "red prev" and innerHTML "Red One".
    • type
      Function
  • dojo.NodeList.andSelf

    • summary
      Adds the nodes from the previous dojo.NodeList to the current dojo.NodeList.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red prev">Red One</div>
      		Some Text
      		<div class="blue prev">Blue One</div>
      		<div class="red second">Red Two</div>
      		<div class="blue">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".second").prevAll().andSelf();
      returns the two divs with class of "prev", as well as the div with class "second".
    • type
      Function
  • dojo.NodeList.first

    • returns
      dojo.NodeList
    • summary
      Returns the first node in this dojo.NodeList as a dojo.NodeList.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, with the first node in this dojo.NodeList
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		<div class="blue first">Blue One</div>
      		<div class="red">Red Two</div>
      		<div class="blue last">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".blue").first();
      returns the div with class "blue" and "first".
    • type
      Function
  • dojo.NodeList.last

    • returns
      dojo.NodeList
    • summary
      Returns the last node in this dojo.NodeList as a dojo.NodeList.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, with the last node in this dojo.NodeList
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="red">Red One</div>
      		<div class="blue first">Blue One</div>
      		<div class="red">Red Two</div>
      		<div class="blue last">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".blue").last();
      returns the last div with class "blue",
    • type
      Function
  • dojo.NodeList.even

    • summary
      Returns the even nodes in this dojo.NodeList as a dojo.NodeList.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, with the even nodes in this dojo.NodeList
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="interior red">Red One</div>
      		<div class="interior blue">Blue One</div>
      		<div class="interior red">Red Two</div>
      		<div class="interior blue">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".interior").even();
      returns the two divs with class "blue"
    • type
      Function
  • dojo.NodeList.odd

    • summary
      Returns the odd nodes in this dojo.NodeList as a dojo.NodeList.
    • description
      .end() can be used on the returned dojo.NodeList to get back to the
      original dojo.NodeList.
    • return_summary
      dojo.NodeList, with the odd nodes in this dojo.NodeList
    • example
      assume a DOM created by this markup:
      	<div class="container">
      		<div class="interior red">Red One</div>
      		<div class="interior blue">Blue One</div>
      		<div class="interior red">Red Two</div>
      		<div class="interior blue">Blue Two</div>
      	</div>
      Running this code:
      	dojo.query(".interior").odd();
      returns the two divs with class "red"
    • type
      Function
  • dojo.NodeList-traverse

    • summary
      Adds a chainable methods to dojo.query() / Nodelist instances for traversing the DOM
    • type
      Object
  • dojo

    • type
      Object