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