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