Ext.data.JsonP.Ext_dom_Query({"alternateClassNames":["Ext.DomQuery","Ext.core.DomQuery"],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":null,"uses":[],"html":"
Alternate names
Ext.DomQueryExt.core.DomQueryFiles
Provides high performance selector/xpath processing by compiling queries into reusable functions. New pseudo classes\nand matchers can be plugged. It works on HTML and XML documents (if a content node is passed in).
\n\nDomQuery supports most of the CSS3 selectors spec, along with some custom selectors and basic XPath.
\n\nAll selectors, attribute filters and pseudos below can be combined infinitely in any order. For example\ndiv.foo:nth-child(odd)[@foo=bar].bar:first
would be a perfectly valid selector. Node filters are processed\nin the order in which they appear, which allows you to optimize your queries for your document structure.
*
any elementE
an element with the tag EE F
All descendent elements of E that have the tag FE > F
or E/F all direct children elements of E that have the tag FE + F
all elements with the tag F that are immediately preceded by an element with the tag EE ~ F
all elements with the tag F that are preceded by a sibling element with the tag EThe use of @
and quotes are optional. For example, div[@foo='bar']
is also a valid attribute selector.
E[foo]
has an attribute \"foo\"E[foo=bar]
has an attribute \"foo\" that equals \"bar\"E[foo^=bar]
has an attribute \"foo\" that starts with \"bar\"E[foo$=bar]
has an attribute \"foo\" that ends with \"bar\"E[foo*=bar]
has an attribute \"foo\" that contains the substring \"bar\"E[foo%=2]
has an attribute \"foo\" that is evenly divisible by 2E[foo!=bar]
attribute \"foo\" does not equal \"bar\"E:first-child
E is the first child of its parentE:last-child
E is the last child of its parentE:nth-child(_n_)
E is the _n_th child of its parent (1 based as per the spec)E:nth-child(odd)
E is an odd child of its parentE:nth-child(even)
E is an even child of its parentE:only-child
E is the only child of its parentE:checked
E is an element that is has a checked attribute that is true (e.g. a radio or checkbox)E:first
the first E in the resultsetE:last
the last E in the resultsetE:nth(_n_)
the _n_th E in the resultset (1 based)E:odd
shortcut for :nth-child(odd)E:even
shortcut for :nth-child(even)E:contains(foo)
E's innerHTML contains the substring \"foo\"E:nodeValue(foo)
E contains a textNode with a nodeValue that equals \"foo\"E:not(S)
an E element that does not match simple selector SE:has(S)
an E element that has a descendent that matches simple selector SE:next(S)
an E element whose next sibling matches simple selector SE:prev(S)
an E element whose previous sibling matches simple selector SE:any(S1|S2|S2)
an E element which matches any of the simple selectors S1, S2 or S3E:visible(true)
an E element which is deeply visible according to Ext.dom.Element.isVisibleE{display=none}
css value \"display\" that equals \"none\"E{display^=none}
css value \"display\" that starts with \"none\"E{display$=none}
css value \"display\" that ends with \"none\"E{display*=none}
css value \"display\" that contains the substring \"none\"E{display%=2}
css value \"display\" that is evenly divisible by 2E{display!=none}
css value \"display\" that does not equal \"none\"ns|E
an element with tag E and namespace prefix nsCollection of matching regular expressions and code snippets.\nEach capture group within ()
will be replace the {}
in the select\nstatement as specified by their index.
Collection of operator comparison functions.\nThe default operators are =
, !=
, ^=
, $=
, *=
, %=
, |=
and ~=
.
New operators can be added as long as the match the format c=
where c\nis any character other than space, >
, or <
.
Operator functions are passed the following parameters:
\n\npropValue
: The property value to test.compareTo
: The value to compare to.Object hash of \"pseudo class\" filter functions which are used when filtering selections.\nEach function is passed two parameters:
\n\nc : Array\n An Array of DOM elements to filter.
v : String\n The argument (if any) supplied in the selector.
A filter function returns an Array of DOM elements which conform to the pseudo class.\nIn addition to the provided pseudo classes listed above such as first-child
and nth-child
,\ndevelopers may add additional, custom psuedo class filters to select elements according to application-specific requirements.
For example, to filter a
elements to only return links to external resources:
Ext.DomQuery.pseudos.external = function(c, v) {\n var r = [], ri = -1;\n for(var i = 0, ci; ci = c[i]; i++) {\n // Include in result set only if it's a link to an external resource\n if (ci.hostname != location.hostname) {\n r[++ri] = ci;\n }\n }\n return r;\n};\n
\n\nThen external links could be gathered with the following statement:
\n\nvar externalLinks = Ext.select(\"a:external\");\n
\nCompiles 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.
\nThe selector/xpath query
\nEither \"select\" or \"simple\" for a simple selector match
\nDefaults to: "select"
Filters an array of elements to only include matches of a simple selector\n(e.g. div.some-class
or span:first-child
)
An array of elements to filter
\nThe simple selector to test
\nIf true, it returns the elements that DON'T match the selector instead of the\nones that match
\nAn Array of DOM elements which match the selector. If there are no matches, and empty\nArray is returned.
\nSelects an array of DOM nodes using JavaScript-only implementation.
\n\nUse select to take advantage of browsers built-in support for CSS selectors.
\nThe selector/xpath query (can be a comma separated list of selectors)
\nThe start of the query.
\nDefaults to: document
An Array of DOM elements which match the selector. If there are\nno matches, and empty Array is returned.
\nSelects an array of DOM nodes by CSS/XPath selector.
\n\nUses document.querySelectorAll if browser supports that, otherwise falls back to\njsSelect to do the work.
\n\nAliased as Ext.query.
\nThe selector/xpath query
\n\nThe start of the query.
\n\nDefaults to: document
Either \"select\" or \"simple\" for a simple selector match (only valid when\nused when the call is deferred to the jsSelect method)
\n\nDefaults to: "select"
Pass true
to select only the first matching node using document.querySelector
(where available)
An array of DOM elements (not a NodeList as returned by querySelectorAll
).
Selects a single element.
\nThe selector/xpath query
\nThe start of the query.
\nDefaults to: document
The DOM element which matched the selector.
\nSelects the value of a node, parsing integers and floats.\nReturns the defaultValue, or 0 if none is specified.
\nThe selector/xpath query
\nThe start of the query.
\nDefaults to: document
When specified, this is return as empty value.
\nSelects the value of a node, optionally replacing null with the defaultValue.
\nThe selector/xpath query
\nThe start of the query.
\nDefaults to: document
When specified, this is return as empty value.
\n