| compile( String selector , [String type ] )
- :
- FunctionCompiles a selector/xpath query into a reusable function. The returned function
+
This class is a singleton and cannot be created directly. Public Properties|
| matchers : Object Collection of matching regular expressions and code snippets. | DomQuery | | pseudos : ObjectObject hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed
+two... Object hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed
+two parameters:
+ A filter function returns an Array of DOM elements which conform to the pseudo class.
+ In addition to the provided pseudo classes listed above such as first-child and nth-child ,
+developers 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){
+ var r = [], ri = -1;
+ for(var i = 0, ci; ci = c[i]; i++){
+// Include in result set only if it's a link to an external resource
+ if(ci.hostname != location.hostname){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+};
+Then external links could be gathered with the following statement:
+var externalLinks = Ext.select("a:external");
| DomQuery |
Public Methods|
| compile( String selector , [String type ] )
+ :
+ FunctionCompiles a selector/xpath query into a reusable function. The returned function
takes one parameter "root" (optional... Compiles a selector/xpath query into a reusable function. The returned function
-takes one parameter "root" (optional), which is the context node from where the query should start. | DomQuery | | filter( Array el , String selector , Boolean nonMatches )
- :
+takes one parameter "root" (optional), which is the context node from where the query should start. | DomQuery | | filter( Array el , String selector , Boolean nonMatches )
+ :
ArrayFilters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child) Filters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child) Parameters:el : ArrayAn array of elements to filter selector : StringThe simple selector to test nonMatches : BooleanIf true, it returns the elements that DON'T match
-the selector instead of the ones that match Returns: | DomQuery | | is( String/HTMLElement/Array el , String selector )
- :
- BooleanReturns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child) Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child) | DomQuery | | operators()
- :
- voidCollection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=.
+the selector instead of the ones that match Returns: | DomQuery | | is( String/HTMLElement/Array el , String selector )
+ :
+ BooleanReturns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child) Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child) | DomQuery | | operators()
+ :
+ voidCollection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=.
New operato... Collection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=.
-New operators can be added as long as the match the format c= where c is any character other than space, > <. | DomQuery | | select( String selector , [Node root ] )
- :
- ArraySelects a group of elements. Selects a group of elements. | DomQuery | | selectNode( String selector , [Node root ] )
- :
- ElementSelects a single element. Selects a single element. | DomQuery | | selectNumber( String selector , [Node root ], Number defaultValue )
- :
- NumberSelects the value of a node, parsing integers and floats. Returns the defaultValue, or 0 if none is specified. Selects the value of a node, parsing integers and floats. Returns the defaultValue, or 0 if none is specified. | DomQuery | | selectValue( String selector , [Node root ], String defaultValue )
- :
+New operators can be added as long as the match the format c= where c is any character other than space, > <. | DomQuery | | select( String selector , [Node root ] )
+ :
+ ArraySelects a group of elements. Selects a group of elements. | DomQuery | | selectNode( String selector , [Node root ] )
+ :
+ ElementSelects a single element. Selects a single element. | DomQuery | | selectNumber( String selector , [Node root ], Number defaultValue )
+ :
+ NumberSelects the value of a node, parsing integers and floats. Returns the defaultValue, or 0 if none is specified. Selects the value of a node, parsing integers and floats. Returns the defaultValue, or 0 if none is specified. | DomQuery | | selectValue( String selector , [Node root ], String defaultValue )
+ :
StringSelects the value of a node, optionally replacing null with the defaultValue. Selects the value of a node, optionally replacing null with the defaultValue. | DomQuery |
Public EventsThis class has no public events.
\ No newline at end of file
|