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