Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / source / Element.traversal.html
index df8ae3a..8e4a9d5 100644 (file)
@@ -1,179 +1 @@
-<html>\r
-<head>\r
-  <title>The source code</title>\r
-    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
-    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body  onload="prettyPrint();">\r
-    <pre class="prettyprint lang-js">/**\r
- * @class Ext.Element\r
- */\r
-Ext.Element.addMethods(function(){\r
-       var PARENTNODE = 'parentNode',\r
-               NEXTSIBLING = 'nextSibling',\r
-               PREVIOUSSIBLING = 'previousSibling',\r
-               DQ = Ext.DomQuery,\r
-               GET = Ext.get;\r
-       \r
-       return {\r
-               <div id="method-Ext.Element-findParent"></div>/**\r
-            * Looks at this node and then at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)\r
-            * @param {String} selector The simple selector to test\r
-            * @param {Number/Mixed} maxDepth (optional) The max depth to search as a number or element (defaults to 50 || document.body)\r
-            * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node\r
-            * @return {HTMLElement} The matching DOM node (or null if no match was found)\r
-            */\r
-           findParent : function(simpleSelector, maxDepth, returnEl){\r
-               var p = this.dom,\r
-                       b = document.body, \r
-                       depth = 0,                      \r
-                       stopEl;         \r
-            if(Ext.isGecko && Object.prototype.toString.call(p) == '[object XULElement]') {\r
-                return null;\r
-            }\r
-               maxDepth = maxDepth || 50;\r
-               if (isNaN(maxDepth)) {\r
-                   stopEl = Ext.getDom(maxDepth);\r
-                   maxDepth = Number.MAX_VALUE;\r
-               }\r
-               while(p && p.nodeType == 1 && depth < maxDepth && p != b && p != stopEl){\r
-                   if(DQ.is(p, simpleSelector)){\r
-                       return returnEl ? GET(p) : p;\r
-                   }\r
-                   depth++;\r
-                   p = p.parentNode;\r
-               }\r
-               return null;\r
-           },\r
-       \r
-           <div id="method-Ext.Element-findParentNode"></div>/**\r
-            * Looks at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)\r
-            * @param {String} selector The simple selector to test\r
-            * @param {Number/Mixed} maxDepth (optional) The max depth to\r
-                   search as a number or element (defaults to 10 || document.body)\r
-            * @param {Boolean} returnEl (optional) True to return a Ext.Element object instead of DOM node\r
-            * @return {HTMLElement} The matching DOM node (or null if no match was found)\r
-            */\r
-           findParentNode : function(simpleSelector, maxDepth, returnEl){\r
-               var p = Ext.fly(this.dom.parentNode, '_internal');\r
-               return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null;\r
-           },\r
-       \r
-           <div id="method-Ext.Element-up"></div>/**\r
-            * Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child).\r
-            * This is a shortcut for findParentNode() that always returns an Ext.Element.\r
-            * @param {String} selector The simple selector to test\r
-            * @param {Number/Mixed} maxDepth (optional) The max depth to\r
-                   search as a number or element (defaults to 10 || document.body)\r
-            * @return {Ext.Element} The matching DOM node (or null if no match was found)\r
-            */\r
-           up : function(simpleSelector, maxDepth){\r
-               return this.findParentNode(simpleSelector, maxDepth, true);\r
-           },\r
-       \r
-           <div id="method-Ext.Element-select"></div>/**\r
-            * Creates a {@link Ext.CompositeElement} for child nodes based on the passed CSS selector (the selector should not contain an id).\r
-            * @param {String} selector The CSS selector\r
-            * @param {Boolean} unique (optional) True to create a unique Ext.Element for each child (defaults to false, which creates a single shared flyweight object)\r
-            * @return {CompositeElement/CompositeElementLite} The composite element\r
-            */\r
-           select : function(selector, unique){\r
-               return Ext.Element.select(selector, unique, this.dom);\r
-           },\r
-       \r
-           <div id="method-Ext.Element-query"></div>/**\r
-            * Selects child nodes based on the passed CSS selector (the selector should not contain an id).\r
-            * @param {String} selector The CSS selector\r
-            * @return {Array} An array of the matched nodes\r
-            */\r
-           query : function(selector, unique){\r
-               return DQ.select(selector, this.dom);\r
-           },\r
-       \r
-           <div id="method-Ext.Element-child"></div>/**\r
-            * Selects a single child at any depth below this element based on the passed CSS selector (the selector should not contain an id).\r
-            * @param {String} selector The CSS selector\r
-            * @param {Boolean} returnDom (optional) True to return the DOM node instead of Ext.Element (defaults to false)\r
-            * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true)\r
-            */\r
-           child : function(selector, returnDom){\r
-               var n = DQ.selectNode(selector, this.dom);\r
-               return returnDom ? n : GET(n);\r
-           },\r
-       \r
-           <div id="method-Ext.Element-down"></div>/**\r
-            * Selects a single *direct* child based on the passed CSS selector (the selector should not contain an id).\r
-            * @param {String} selector The CSS selector\r
-            * @param {Boolean} returnDom (optional) True to return the DOM node instead of Ext.Element (defaults to false)\r
-            * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true)\r
-            */\r
-           down : function(selector, returnDom){\r
-               var n = DQ.selectNode(" > " + selector, this.dom);\r
-               return returnDom ? n : GET(n);\r
-           },\r
-       \r
-                <div id="method-Ext.Element-parent"></div>/**\r
-            * Gets the parent node for this element, optionally chaining up trying to match a selector\r
-            * @param {String} selector (optional) Find a parent node that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The parent node or null\r
-                */\r
-           parent : function(selector, returnDom){\r
-               return this.matchNode(PARENTNODE, PARENTNODE, selector, returnDom);\r
-           },\r
-       \r
-            <div id="method-Ext.Element-next"></div>/**\r
-            * Gets the next sibling, skipping text nodes\r
-            * @param {String} selector (optional) Find the next sibling that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The next sibling or null\r
-                */\r
-           next : function(selector, returnDom){\r
-               return this.matchNode(NEXTSIBLING, NEXTSIBLING, selector, returnDom);\r
-           },\r
-       \r
-           <div id="method-Ext.Element-prev"></div>/**\r
-            * Gets the previous sibling, skipping text nodes\r
-            * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The previous sibling or null\r
-                */\r
-           prev : function(selector, returnDom){\r
-               return this.matchNode(PREVIOUSSIBLING, PREVIOUSSIBLING, selector, returnDom);\r
-           },\r
-       \r
-       \r
-           <div id="method-Ext.Element-first"></div>/**\r
-            * Gets the first child, skipping text nodes\r
-            * @param {String} selector (optional) Find the next sibling that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The first child or null\r
-                */\r
-           first : function(selector, returnDom){\r
-               return this.matchNode(NEXTSIBLING, 'firstChild', selector, returnDom);\r
-           },\r
-       \r
-           <div id="method-Ext.Element-last"></div>/**\r
-            * Gets the last child, skipping text nodes\r
-            * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector\r
-            * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element\r
-            * @return {Ext.Element/HTMLElement} The last child or null\r
-                */\r
-           last : function(selector, returnDom){\r
-               return this.matchNode(PREVIOUSSIBLING, 'lastChild', selector, returnDom);\r
-           },\r
-           \r
-           matchNode : function(dir, start, selector, returnDom){\r
-               var n = this.dom[start];\r
-               while(n){\r
-                   if(n.nodeType == 1 && (!selector || DQ.is(n, selector))){\r
-                       return !returnDom ? GET(n) : n;\r
-                   }\r
-                   n = n[dir];\r
-               }\r
-               return null;\r
-           }   \r
-    }\r
-}());</pre>    \r
-</body>\r
-</html>
\ No newline at end of file
+<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre></pre></pre></body></html>
\ No newline at end of file