Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / output / Ext.DomQuery.js
1 Ext.data.JsonP.Ext_DomQuery({
2   "allMixins": [
3
4   ],
5   "deprecated": null,
6   "docauthor": null,
7   "members": {
8     "cfg": [
9
10     ],
11     "method": [
12       {
13         "deprecated": null,
14         "alias": null,
15         "protected": false,
16         "tagname": "method",
17         "href": "DomQuery.html#Ext-DomQuery-method-compile",
18         "shortDoc": "Compiles a selector/xpath query into a reusable function. ...",
19         "static": false,
20         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
21         "private": false,
22         "params": [
23           {
24             "type": "String",
25             "optional": false,
26             "doc": "<p>The selector/xpath query</p>\n",
27             "name": "selector"
28           },
29           {
30             "type": "String",
31             "optional": true,
32             "doc": "<p>(optional) Either \"select\" (the default) or \"simple\" for a simple selector match</p>\n",
33             "name": "type"
34           }
35         ],
36         "name": "compile",
37         "owner": "Ext.DomQuery",
38         "doc": "<p>Compiles a selector/xpath query into a reusable function. The returned function\ntakes one parameter \"root\" (optional), which is the context node from where the query should start.</p>\n",
39         "linenr": 431,
40         "return": {
41           "type": "Function",
42           "doc": "\n"
43         },
44         "html_filename": "DomQuery.html"
45       },
46       {
47         "deprecated": null,
48         "alias": null,
49         "protected": false,
50         "tagname": "method",
51         "href": "DomQuery.html#Ext-DomQuery-method-filter",
52         "shortDoc": "Filters an array of elements to only include matches of a simple selector (e.g. ...",
53         "static": false,
54         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
55         "private": false,
56         "params": [
57           {
58             "type": "Array",
59             "optional": false,
60             "doc": "<p>An array of elements to filter</p>\n",
61             "name": "el"
62           },
63           {
64             "type": "String",
65             "optional": false,
66             "doc": "<p>The simple selector to test</p>\n",
67             "name": "selector"
68           },
69           {
70             "type": "Boolean",
71             "optional": false,
72             "doc": "<p>If true, it returns the elements that DON'T match\nthe selector instead of the ones that match</p>\n",
73             "name": "nonMatches"
74           }
75         ],
76         "name": "filter",
77         "owner": "Ext.DomQuery",
78         "doc": "<p>Filters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child)</p>\n",
79         "linenr": 672,
80         "return": {
81           "type": "Array",
82           "doc": "<p>An Array of DOM elements which match the selector. If there are\nno matches, and empty Array is returned.</p>\n"
83         },
84         "html_filename": "DomQuery.html"
85       },
86       {
87         "deprecated": null,
88         "alias": null,
89         "protected": false,
90         "tagname": "method",
91         "href": "DomQuery.html#Ext-DomQuery-method-is",
92         "shortDoc": "Returns true if the passed element(s) match the passed simple selector (e.g. ...",
93         "static": false,
94         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
95         "private": false,
96         "params": [
97           {
98             "type": "String/HTMLElement/Array",
99             "optional": false,
100             "doc": "<p>An element id, element or array of elements</p>\n",
101             "name": "el"
102           },
103           {
104             "type": "String",
105             "optional": false,
106             "doc": "<p>The simple selector to test</p>\n",
107             "name": "selector"
108           }
109         ],
110         "name": "is",
111         "owner": "Ext.DomQuery",
112         "doc": "<p>Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child)</p>\n",
113         "linenr": 657,
114         "return": {
115           "type": "Boolean",
116           "doc": "\n"
117         },
118         "html_filename": "DomQuery.html"
119       },
120       {
121         "deprecated": null,
122         "alias": null,
123         "protected": false,
124         "tagname": "method",
125         "href": "DomQuery.html#Ext-DomQuery-method-jsSelect",
126         "shortDoc": "Selects an array of DOM nodes using JavaScript-only implementation. ...",
127         "static": false,
128         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
129         "private": false,
130         "params": [
131           {
132             "type": "String",
133             "optional": false,
134             "doc": "<p>The selector/xpath query (can be a comma separated list of selectors)</p>\n",
135             "name": "selector"
136           },
137           {
138             "type": "Node/String",
139             "optional": true,
140             "doc": "<p>(optional) The start of the query (defaults to document).</p>\n",
141             "name": "root"
142           },
143           {
144             "type": "Object",
145             "optional": false,
146             "doc": "\n",
147             "name": "type"
148           }
149         ],
150         "name": "jsSelect",
151         "owner": "Ext.DomQuery",
152         "doc": "<p>Selects an array of DOM nodes using JavaScript-only implementation.</p>\n\n<p>Use <a href=\"#/api/Ext.DomQuery-method-select\" rel=\"Ext.DomQuery-method-select\" class=\"docClass\">select</a> to take advantage of browsers built-in support for CSS selectors.</p>\n",
153         "linenr": 525,
154         "return": {
155           "type": "Array",
156           "doc": "<p>An Array of DOM elements which match the selector. If there are\nno matches, and empty Array is returned.</p>\n"
157         },
158         "html_filename": "DomQuery.html"
159       },
160       {
161         "deprecated": null,
162         "alias": null,
163         "protected": false,
164         "tagname": "method",
165         "href": "DomQuery.html#Ext-DomQuery-method-select",
166         "shortDoc": "Selects an array of DOM nodes by CSS/XPath selector. ...",
167         "static": false,
168         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
169         "private": false,
170         "params": [
171           {
172             "type": "String",
173             "optional": false,
174             "doc": "<p>The selector/xpath query</p>\n",
175             "name": "path"
176           },
177           {
178             "type": "Node",
179             "optional": true,
180             "doc": "<p>(optional) The start of the query (defaults to document).</p>\n",
181             "name": "root"
182           }
183         ],
184         "name": "select",
185         "owner": "Ext.DomQuery",
186         "doc": "<p>Selects an array of DOM nodes by CSS/XPath selector.</p>\n\n<p>Uses <a href=\"https://developer.mozilla.org/en/DOM/document.querySelectorAll\">document.querySelectorAll</a> if browser supports that, otherwise falls back to\n<a href=\"#/api/Ext.DomQuery-method-jsSelect\" rel=\"Ext.DomQuery-method-jsSelect\" class=\"docClass\">jsSelect</a> to do the work.</p>\n\n<p>Aliased as <a href=\"#/api/Ext-method-query\" rel=\"Ext-method-query\" class=\"docClass\">Ext.query</a>.</p>\n",
187         "linenr": 580,
188         "return": {
189           "type": "Array",
190           "doc": "<p>An array of DOM elements (not a NodeList as returned by <code>querySelectorAll</code>).\nEmpty array when no matches.</p>\n"
191         },
192         "html_filename": "DomQuery.html"
193       },
194       {
195         "deprecated": null,
196         "alias": null,
197         "protected": false,
198         "tagname": "method",
199         "href": "DomQuery.html#Ext-DomQuery-method-selectNode",
200         "shortDoc": "Selects a single element. ...",
201         "static": false,
202         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
203         "private": false,
204         "params": [
205           {
206             "type": "String",
207             "optional": false,
208             "doc": "<p>The selector/xpath query</p>\n",
209             "name": "selector"
210           },
211           {
212             "type": "Node",
213             "optional": true,
214             "doc": "<p>(optional) The start of the query (defaults to document).</p>\n",
215             "name": "root"
216           }
217         ],
218         "name": "selectNode",
219         "owner": "Ext.DomQuery",
220         "doc": "<p>Selects a single element.</p>\n",
221         "linenr": 610,
222         "return": {
223           "type": "Element",
224           "doc": "<p>The DOM element which matched the selector.</p>\n"
225         },
226         "html_filename": "DomQuery.html"
227       },
228       {
229         "deprecated": null,
230         "alias": null,
231         "protected": false,
232         "tagname": "method",
233         "href": "DomQuery.html#Ext-DomQuery-method-selectNumber",
234         "shortDoc": "Selects the value of a node, parsing integers and floats. ...",
235         "static": false,
236         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
237         "private": false,
238         "params": [
239           {
240             "type": "String",
241             "optional": false,
242             "doc": "<p>The selector/xpath query</p>\n",
243             "name": "selector"
244           },
245           {
246             "type": "Node",
247             "optional": true,
248             "doc": "<p>(optional) The start of the query (defaults to document).</p>\n",
249             "name": "root"
250           },
251           {
252             "type": "Number",
253             "optional": false,
254             "doc": "\n",
255             "name": "defaultValue"
256           }
257         ],
258         "name": "selectNumber",
259         "owner": "Ext.DomQuery",
260         "doc": "<p>Selects the value of a node, parsing integers and floats. Returns the defaultValue, or 0 if none is specified.</p>\n",
261         "linenr": 645,
262         "return": {
263           "type": "Number",
264           "doc": "\n"
265         },
266         "html_filename": "DomQuery.html"
267       },
268       {
269         "deprecated": null,
270         "alias": null,
271         "protected": false,
272         "tagname": "method",
273         "href": "DomQuery.html#Ext-DomQuery-method-selectValue",
274         "shortDoc": "Selects the value of a node, optionally replacing null with the defaultValue. ...",
275         "static": false,
276         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
277         "private": false,
278         "params": [
279           {
280             "type": "String",
281             "optional": false,
282             "doc": "<p>The selector/xpath query</p>\n",
283             "name": "selector"
284           },
285           {
286             "type": "Node",
287             "optional": true,
288             "doc": "<p>(optional) The start of the query (defaults to document).</p>\n",
289             "name": "root"
290           },
291           {
292             "type": "String",
293             "optional": false,
294             "doc": "\n",
295             "name": "defaultValue"
296           }
297         ],
298         "name": "selectValue",
299         "owner": "Ext.DomQuery",
300         "doc": "<p>Selects the value of a node, optionally replacing null with the defaultValue.</p>\n",
301         "linenr": 620,
302         "return": {
303           "type": "String",
304           "doc": "\n"
305         },
306         "html_filename": "DomQuery.html"
307       }
308     ],
309     "property": [
310       {
311         "type": "Object",
312         "deprecated": null,
313         "alias": null,
314         "protected": false,
315         "tagname": "property",
316         "href": "DomQuery.html#Ext-DomQuery-property-matchers",
317         "shortDoc": "Collection of matching regular expressions and code snippets. ...",
318         "static": false,
319         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
320         "private": false,
321         "name": "matchers",
322         "owner": "Ext.DomQuery",
323         "doc": "<p>Collection of matching regular expressions and code snippets.\nEach capture group within () will be replace the {} in the select\nstatement as specified by their index.</p>\n",
324         "linenr": 690,
325         "html_filename": "DomQuery.html"
326       },
327       {
328         "type": "Object",
329         "deprecated": null,
330         "alias": null,
331         "protected": false,
332         "tagname": "property",
333         "href": "DomQuery.html#Ext-DomQuery-property-operators",
334         "shortDoc": "Collection of operator comparison functions. ...",
335         "static": false,
336         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
337         "private": false,
338         "name": "operators",
339         "owner": "Ext.DomQuery",
340         "doc": "<p>Collection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=.\nNew operators can be added as long as the match the format <i>c</i>= where <i>c</i> is any character other than space, &gt; &lt;.</p>\n",
341         "linenr": 713,
342         "html_filename": "DomQuery.html"
343       },
344       {
345         "type": "Object",
346         "deprecated": null,
347         "alias": null,
348         "protected": false,
349         "tagname": "property",
350         "href": "DomQuery.html#Ext-DomQuery-property-pseudos",
351         "shortDoc": "Object hash of \"pseudo class\" filter functions which are used when filtering selections. ...",
352         "static": false,
353         "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
354         "private": false,
355         "name": "pseudos",
356         "owner": "Ext.DomQuery",
357         "doc": "<p>Object hash of \"pseudo class\" filter functions which are used when filtering selections.\nEach function is passed two parameters:</p>\n\n<ul>\n<li><p><strong>c</strong> : Array\n  An Array of DOM elements to filter.</p></li>\n<li><p><strong>v</strong> : String\n  The argument (if any) supplied in the selector.</p></li>\n</ul>\n\n\n<p>A filter function returns an Array of DOM elements which conform to the pseudo class.\nIn addition to the provided pseudo classes listed above such as <code>first-child</code> and <code>nth-child</code>,\ndevelopers may add additional, custom psuedo class filters to select elements according to application-specific requirements.</p>\n\n<p>For example, to filter <code>a</code> elements to only return links to <strong>external</strong> resources:</p>\n\n<pre><code>Ext.DomQuery.pseudos.external = function(c, v){\n    var r = [], ri = -1;\n    for(var i = 0, ci; ci = c[i]; i++){\n        // Include in result set only if it's a link to an external resource\n        if(ci.hostname != location.hostname){\n            r[++ri] = ci;\n        }\n    }\n    return r;\n};\n</code></pre>\n\n<p>Then external links could be gathered with the following statement:</p>\n\n<pre><code>var externalLinks = Ext.select(\"a:external\");\n</code></pre>\n",
358         "linenr": 744,
359         "html_filename": "DomQuery.html"
360       }
361     ],
362     "cssVar": [
363
364     ],
365     "cssMixin": [
366
367     ],
368     "event": [
369
370     ]
371   },
372   "singleton": true,
373   "alias": null,
374   "superclasses": [
375
376   ],
377   "protected": false,
378   "tagname": "class",
379   "mixins": [
380
381   ],
382   "href": "DomQuery.html#Ext-DomQuery",
383   "subclasses": [
384
385   ],
386   "static": false,
387   "author": null,
388   "component": false,
389   "filename": "/mnt/ebs/nightly/git/SDK/platform/core/src/dom/DomQuery.js",
390   "private": false,
391   "alternateClassNames": [
392
393   ],
394   "name": "Ext.DomQuery",
395   "doc": "<p>Provides high performance selector/xpath processing by compiling queries into reusable functions. New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in).</p>\n\n<p>\nDomQuery supports most of the <a href=\"http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#selectors\">CSS3 selectors spec</a>, along with some custom selectors and basic XPath.</p>\n\n\n\n\n<p>\nAll selectors, attribute filters and pseudos below can be combined infinitely in any order. For example \"div.foo:nth-child(odd)[@foo=bar].bar:first\" would be a perfectly valid selector. Node filters are processed in the order in which they appear, which allows you to optimize your queries for your document structure.\n</p>\n\n\n<h4>Element Selectors:</h4>\n\n\n<ul class=\"list\">\n    <li> <b>*</b> any element</li>\n    <li> <b>E</b> an element with the tag E</li>\n    <li> <b>E F</b> All descendent elements of E that have the tag F</li>\n    <li> <b>E > F</b> or <b>E/F</b> all direct children elements of E that have the tag F</li>\n    <li> <b>E + F</b> all elements with the tag F that are immediately preceded by an element with the tag E</li>\n    <li> <b>E ~ F</b> all elements with the tag F that are preceded by a sibling element with the tag E</li>\n</ul>\n\n\n<h4>Attribute Selectors:</h4>\n\n\n<p>The use of &#64; and quotes are optional. For example, div[&#64;foo='bar'] is also a valid attribute selector.</p>\n\n\n<ul class=\"list\">\n    <li> <b>E[foo]</b> has an attribute \"foo\"</li>\n    <li> <b>E[foo=bar]</b> has an attribute \"foo\" that equals \"bar\"</li>\n    <li> <b>E[foo^=bar]</b> has an attribute \"foo\" that starts with \"bar\"</li>\n    <li> <b>E[foo$=bar]</b> has an attribute \"foo\" that ends with \"bar\"</li>\n    <li> <b>E[foo*=bar]</b> has an attribute \"foo\" that contains the substring \"bar\"</li>\n    <li> <b>E[foo%=2]</b> has an attribute \"foo\" that is evenly divisible by 2</li>\n    <li> <b>E[foo!=bar]</b> attribute \"foo\" does not equal \"bar\"</li>\n</ul>\n\n\n<h4>Pseudo Classes:</h4>\n\n\n<ul class=\"list\">\n    <li> <b>E:first-child</b> E is the first child of its parent</li>\n    <li> <b>E:last-child</b> E is the last child of its parent</li>\n    <li> <b>E:nth-child(<i>n</i>)</b> E is the <i>n</i>th child of its parent (1 based as per the spec)</li>\n    <li> <b>E:nth-child(odd)</b> E is an odd child of its parent</li>\n    <li> <b>E:nth-child(even)</b> E is an even child of its parent</li>\n    <li> <b>E:only-child</b> E is the only child of its parent</li>\n    <li> <b>E:checked</b> E is an element that is has a checked attribute that is true (e.g. a radio or checkbox) </li>\n    <li> <b>E:first</b> the first E in the resultset</li>\n    <li> <b>E:last</b> the last E in the resultset</li>\n    <li> <b>E:nth(<i>n</i>)</b> the <i>n</i>th E in the resultset (1 based)</li>\n    <li> <b>E:odd</b> shortcut for :nth-child(odd)</li>\n    <li> <b>E:even</b> shortcut for :nth-child(even)</li>\n    <li> <b>E:contains(foo)</b> E's innerHTML contains the substring \"foo\"</li>\n    <li> <b>E:nodeValue(foo)</b> E contains a textNode with a nodeValue that equals \"foo\"</li>\n    <li> <b>E:not(S)</b> an E element that does not match simple selector S</li>\n    <li> <b>E:has(S)</b> an E element that has a descendent that matches simple selector S</li>\n    <li> <b>E:next(S)</b> an E element whose next sibling matches simple selector S</li>\n    <li> <b>E:prev(S)</b> an E element whose previous sibling matches simple selector S</li>\n    <li> <b>E:any(S1|S2|S2)</b> an E element which matches any of the simple selectors S1, S2 or S3//\\\\</li>\n</ul>\n\n\n<h4>CSS Value Selectors:</h4>\n\n\n<ul class=\"list\">\n    <li> <b>E{display=none}</b> css value \"display\" that equals \"none\"</li>\n    <li> <b>E{display^=none}</b> css value \"display\" that starts with \"none\"</li>\n    <li> <b>E{display$=none}</b> css value \"display\" that ends with \"none\"</li>\n    <li> <b>E{display*=none}</b> css value \"display\" that contains the substring \"none\"</li>\n    <li> <b>E{display%=2}</b> css value \"display\" that is evenly divisible by 2</li>\n    <li> <b>E{display!=none}</b> css value \"display\" that does not equal \"none\"</li>\n</ul>\n\n",
396   "mixedInto": [
397
398   ],
399   "linenr": 5,
400   "xtypes": [
401
402   ],
403   "html_filename": "DomQuery.html",
404   "extends": null
405 });