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