X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..05ce1c11e98b33f14ddee184493bd5a60dc947e2:/docs/source/DomQuery.html diff --git a/docs/source/DomQuery.html b/docs/source/DomQuery.html index 712f2289..51fe6d2b 100644 --- a/docs/source/DomQuery.html +++ b/docs/source/DomQuery.html @@ -1,11 +1,17 @@ - - - The source code - - - - -
/*
+
+
+  The source code
+    
+    
+
+
+    
/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+/*
  * This is code is also distributed under MIT license for use
  * with jQuery and prototype JavaScript libraries.
  */
@@ -629,8 +635,29 @@ Ext.DomQuery = function(){
         },
 
         
/** - * Collection of "pseudo class" processors. Each processor is passed the current nodeset (array) - * and the argument (if any) supplied in the selector. + *

Object hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed + * two parameters:

    + *
  • c : Array
    An Array of DOM elements to filter.
  • + *
  • v : String
    The argument (if any) supplied in the selector.
  • + *
+ *

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");
+
*/ pseudos : { "first-child" : function(c){ @@ -825,6 +852,6 @@ Ext.DomQuery = function(){ * @method query */ Ext.query = Ext.DomQuery.select; -
- +
+ \ No newline at end of file