X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6a7e4474cba9d8be4b2ec445e10f1691f7277c50..b37ceabb82336ee82757cd32efe353cfab8ec267:/docs/source/CompositeElementLite.html diff --git a/docs/source/CompositeElementLite.html b/docs/source/CompositeElementLite.html index 87fc3fff..473e67c6 100644 --- a/docs/source/CompositeElementLite.html +++ b/docs/source/CompositeElementLite.html @@ -7,12 +7,12 @@
/*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.2 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -/** +/** * @class Ext.CompositeElementLite *+Ext.select = Ext.Element.select; +This class encapsulates a collection of DOM elements, providing methods to filter * members, or to perform collective actions upon the whole set.
@@ -63,8 +63,8 @@ Ext.override(Ext.CompositeElementLite, { }; Ext.CompositeElementLite.prototype = { - isComposite: true, - + isComposite: true, + // private getElement : function(el){ // Set the shared flyweight dom property to the current element @@ -73,19 +73,19 @@ Ext.CompositeElementLite.prototype = { e.id = el.id; return e; }, - + // private transformElement : function(el){ return Ext.getDom(el); }, - + /** * Returns the number of elements in this Composite. * @return Number */ getCount : function(){ return this.elements.length; - }, + }, /** * Adds elements to this Composite object. * @param {Mixed} els Either an Array of DOM elements to add, or another Composite object who's elements should be added. @@ -97,27 +97,27 @@ Ext.CompositeElementLite.prototype = { if(!els){ return this; } - if(Ext.isString(els)){ + if(typeof els == "string"){ els = Ext.Element.selectorFunction(els, root); }else if(els.isComposite){ els = els.elements; }else if(!Ext.isIterable(els)){ els = [els]; } - + for(var i = 0, len = els.length; i < len; ++i){ elements.push(me.transformElement(els[i])); } return me; }, - + invoke : function(fn, args){ var me = this, els = me.elements, - len = els.length, - e, + len = els.length, + e, i; - + for(i = 0; i < len; i++) { e = els[i]; if(e){ @@ -147,7 +147,7 @@ Ext.CompositeElementLite.prototype = { var els = this.elements, len = els.length, i, e; - + for(i = 0; ithis reference) in which the function is executed. (defaults to the Element) * @return {CompositeElement} this */ - each : function(fn, scope){ + each : function(fn, scope){ var me = this, els = me.elements, len = els.length, i, e; - + for(i = 0; i /** * Clears this Composite and adds the elements passed. * @param {Mixed} els Either an array of DOM elements, or another Composite from which to fill this Composite. @@ -197,7 +197,7 @@ Ext.CompositeElementLite.prototype = { me.add(els); return me; }, - + /** * Filters this composite to only elements that match the passed selector. * @param {String/Function} selector A string CSS selector or a comparison function. @@ -210,22 +210,21 @@ Ext.CompositeElementLite.prototype = { filter : function(selector){ var els = [], me = this, - elements = me.elements, fn = Ext.isFunction(selector) ? selector : function(el){ return el.is(selector); }; - - - me.each(function(el, self, i){ - if(fn(el, i) !== false){ + + me.each(function(el, self, i) { + if (fn(el, i) !== false) { els[els.length] = me.transformElement(el); } }); + me.elements = els; return me; }, - + /** * Find the index of the passed element within the composite collection. * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection. @@ -234,7 +233,7 @@ Ext.CompositeElementLite.prototype = { indexOf : function(el){ return this.elements.indexOf(this.transformElement(el)); }, - + /** * Replaces the specified element with the passed element. * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite @@ -242,7 +241,7 @@ Ext.CompositeElementLite.prototype = { * @param {Mixed} replacement The id of an element or the Element itself. * @param {Boolean} domReplace (Optional) True to remove and replace the element in the document too. * @return {CompositeElement} this - */ + */ replaceElement : function(el, replacement, domReplace){ var index = !isNaN(el) ? el : this.indexOf(el), d; @@ -257,7 +256,7 @@ Ext.CompositeElementLite.prototype = { } return this; }, - + /** * Removes all elements. */ @@ -272,22 +271,22 @@ Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addLi var fnName, ElProto = Ext.Element.prototype, CelProto = Ext.CompositeElementLite.prototype; - + for(fnName in ElProto){ if(Ext.isFunction(ElProto[fnName])){ - (function(fnName){ + (function(fnName){ CelProto[fnName] = CelProto[fnName] || function(){ return this.invoke(fnName, arguments); }; }).call(CelProto, fnName); - + } } })(); if(Ext.DomQuery){ Ext.Element.selectorFunction = Ext.DomQuery.select; -} +} /** * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods @@ -320,6 +319,7 @@ Ext.Element.select = function(selector, root){ * @member Ext * @method select */ -Ext.select = Ext.Element.select;