sync
[roojs1] / docs / symbols / Roo.DomQuery.json
1 {
2   "name" : "Roo.DomQuery",
3   "augments" : [],
4   "childClasses" : {  },
5   "tree_children" : [],
6   "tree_parent" : [],
7   "desc" : "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).\n<p>\nDomQuery supports most of the <a href=\"http://www.w3.org/TR/2005/WD-css3-selectors-20051215/\">CSS3 selectors spec</a>, along with some custom selectors and basic XPath.</p>\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<h4>Element Selectors:</h4>\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<h4>Attribute Selectors:</h4>\n<p>The use of @ and quotes are optional. For example, div[@foo='bar'] is also a valid attribute selector.</p>\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> has an attribute \"foo\" that does not equal \"bar\"</li>\n</ul>\n<h4>Pseudo Classes:</h4>\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</ul>\n<h4>CSS Value Selectors:</h4>\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>",
8   "isSingleton" : true,
9   "isStatic" : true,
10   "isBuiltin" : false,
11   "isAbstract" : false,
12   "isBuilderTop" : false,
13   "memberOf" : "DomQuery",
14   "example" : "",
15   "deprecated" : "",
16   "since" : "",
17   "see" : "",
18   "params" : [],
19   "returns" : [],
20   "throws" : "",
21   "requires" : "",
22   "config" : [],
23   "methods" : [
24     {
25       "name" : "selectNumber",
26       "type" : "function",
27       "desc" : "Selects the value of a node, parsing integers and floats.",
28       "sig" : "(selector, root, defaultValue)",
29       "static" : false,
30       "memberOf" : "",
31       "isStatic" : false,
32       "isConstructor" : false,
33       "isPrivate" : false,
34       "example" : "",
35       "deprecated" : "",
36       "since" : "",
37       "see" : "",
38       "exceptions" : "",
39       "requires" : "",
40       "params" : [
41         {
42           "name" : "selector",
43           "type" : "String",
44           "desc" : "The selector/xpath query",
45           "isOptional" : false
46         },
47         {
48           "name" : "root",
49           "type" : "Node",
50           "desc" : "(optional) The start of the query (defaults to document).",
51           "isOptional" : false
52         },
53         {
54           "name" : "defaultValue",
55           "type" : "Number",
56           "desc" : "",
57           "isOptional" : false
58         }
59       ],
60       "returns" : [
61         {
62           "name" : "",
63           "type" : "Number",
64           "desc" : ""
65         }
66       ]
67     },
68     {
69       "name" : "is",
70       "type" : "function",
71       "desc" : "Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child)",
72       "sig" : "(el, selector)",
73       "static" : false,
74       "memberOf" : "",
75       "isStatic" : false,
76       "isConstructor" : false,
77       "isPrivate" : false,
78       "example" : "",
79       "deprecated" : "",
80       "since" : "",
81       "see" : "",
82       "exceptions" : "",
83       "requires" : "",
84       "params" : [
85         {
86           "name" : "el",
87           "type" : "String/HTMLElement/Array",
88           "desc" : "An element id, element or array of elements",
89           "isOptional" : false
90         },
91         {
92           "name" : "selector",
93           "type" : "String",
94           "desc" : "The simple selector to test",
95           "isOptional" : false
96         }
97       ],
98       "returns" : [
99         {
100           "name" : "",
101           "type" : "Boolean",
102           "desc" : ""
103         }
104       ]
105     },
106     {
107       "name" : "selectValue",
108       "type" : "function",
109       "desc" : "Selects the value of a node, optionally replacing null with the defaultValue.",
110       "sig" : "(selector, root, defaultValue)",
111       "static" : false,
112       "memberOf" : "",
113       "isStatic" : false,
114       "isConstructor" : false,
115       "isPrivate" : false,
116       "example" : "",
117       "deprecated" : "",
118       "since" : "",
119       "see" : "",
120       "exceptions" : "",
121       "requires" : "",
122       "params" : [
123         {
124           "name" : "selector",
125           "type" : "String",
126           "desc" : "The selector/xpath query",
127           "isOptional" : false
128         },
129         {
130           "name" : "root",
131           "type" : "Node",
132           "desc" : "(optional) The start of the query (defaults to document).",
133           "isOptional" : false
134         },
135         {
136           "name" : "defaultValue",
137           "type" : "String",
138           "desc" : "",
139           "isOptional" : false
140         }
141       ],
142       "returns" : []
143     },
144     {
145       "name" : "filter",
146       "type" : "function",
147       "desc" : "Filters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child)",
148       "sig" : "(el, selector, nonMatches)",
149       "static" : false,
150       "memberOf" : "",
151       "isStatic" : false,
152       "isConstructor" : false,
153       "isPrivate" : false,
154       "example" : "",
155       "deprecated" : "",
156       "since" : "",
157       "see" : "",
158       "exceptions" : "",
159       "requires" : "",
160       "params" : [
161         {
162           "name" : "el",
163           "type" : "Array",
164           "desc" : "An array of elements to filter",
165           "isOptional" : false
166         },
167         {
168           "name" : "selector",
169           "type" : "String",
170           "desc" : "The simple selector to test",
171           "isOptional" : false
172         },
173         {
174           "name" : "nonMatches",
175           "type" : "Boolean",
176           "desc" : "If true, it returns the elements that DON'T match\nthe selector instead of the ones that match",
177           "isOptional" : false
178         }
179       ],
180       "returns" : [
181         {
182           "name" : "",
183           "type" : "Array",
184           "desc" : ""
185         }
186       ]
187     },
188     {
189       "name" : "select",
190       "type" : "function",
191       "desc" : "Selects a group of elements.",
192       "sig" : "(selector, root)",
193       "static" : false,
194       "memberOf" : "",
195       "isStatic" : false,
196       "isConstructor" : false,
197       "isPrivate" : false,
198       "example" : "",
199       "deprecated" : "",
200       "since" : "",
201       "see" : "",
202       "exceptions" : "",
203       "requires" : "",
204       "params" : [
205         {
206           "name" : "selector",
207           "type" : "String",
208           "desc" : "The selector/xpath query (can be a comma separated list of selectors)",
209           "isOptional" : false
210         },
211         {
212           "name" : "root",
213           "type" : "Node",
214           "desc" : "(optional) The start of the query (defaults to document).",
215           "isOptional" : false
216         }
217       ],
218       "returns" : [
219         {
220           "name" : "",
221           "type" : "Array",
222           "desc" : ""
223         }
224       ]
225     },
226     {
227       "name" : "selectNode",
228       "type" : "function",
229       "desc" : "Selects a single element.",
230       "sig" : "(selector, root)",
231       "static" : false,
232       "memberOf" : "",
233       "isStatic" : false,
234       "isConstructor" : false,
235       "isPrivate" : false,
236       "example" : "",
237       "deprecated" : "",
238       "since" : "",
239       "see" : "",
240       "exceptions" : "",
241       "requires" : "",
242       "params" : [
243         {
244           "name" : "selector",
245           "type" : "String",
246           "desc" : "The selector/xpath query",
247           "isOptional" : false
248         },
249         {
250           "name" : "root",
251           "type" : "Node",
252           "desc" : "(optional) The start of the query (defaults to document).",
253           "isOptional" : false
254         }
255       ],
256       "returns" : [
257         {
258           "name" : "",
259           "type" : "Element",
260           "desc" : ""
261         }
262       ]
263     },
264     {
265       "name" : "compile",
266       "type" : "function",
267       "desc" : "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.",
268       "sig" : "(selector, type)",
269       "static" : false,
270       "memberOf" : "",
271       "isStatic" : false,
272       "isConstructor" : false,
273       "isPrivate" : false,
274       "example" : "",
275       "deprecated" : "",
276       "since" : "",
277       "see" : "",
278       "exceptions" : "",
279       "requires" : "",
280       "params" : [
281         {
282           "name" : "selector",
283           "type" : "String",
284           "desc" : "The selector/xpath query",
285           "isOptional" : false
286         },
287         {
288           "name" : "type",
289           "type" : "String",
290           "desc" : "(optional) Either \"select\" (the default) or \"simple\" for a simple selector match",
291           "isOptional" : false
292         }
293       ],
294       "returns" : [
295         {
296           "name" : "",
297           "type" : "Function",
298           "desc" : ""
299         }
300       ]
301     }
302   ],
303   "events" : []
304 }