| elements : ArrayThe Array of DOM elements which this CompositeElement encapsulates. Read-only.
-This will not usually be accessed in ... The Array of DOM elements which this CompositeElement encapsulates. Read-only.
- This will not usually be accessed in developers' code, but developers wishing
-to augment the capabilities of the CompositeElementLite class may use it when adding
-methods to the class.
- For example to add the nextAll method to the class to add all
-following siblings of selected elements, the code would be
-Ext.override(Ext.CompositeElementLite, {
- nextAll: function() {
- var els = this.elements, i, l = els.length, n, r = [], ri = -1;
-
-// Loop through all elements in this Composite, accumulating
-// an Array of all siblings.
- for (i = 0; i < l; i++) {
- for (n = els[i].nextSibling; n; n = n.nextSibling) {
- r[++ri] = n;
- }
- }
-
-// Add all found siblings to this Composite
- return this.add(r);
- }
+This class encapsulates a collection of DOM elements, providing methods to filter
+members, or to perform collective actions upon the whole set.
+ Although they are not listed, this class supports all of the methods of Ext.Element and
+Ext.Fx. The methods from these classes will be performed on all the elements in this collection.
+ All methods return this and can be chained.
+Usage:
+ var els = Ext.select("#some-el div.some-class", true);
+// or select directly from an existing element
+var el = Ext.get('some-el');
+el.select('div.some-class', true);
+
+els.setWidth(100); // all elements become 100 width
+els.hide(true); // all elements fade out and hide
+// or
+els.setWidth(100).hide(true);
Public Properties|
| elements : ArrayThe Array of DOM elements which this CompositeElement encapsulates. Read-only.
+This will not usually be accessed in d... The Array of DOM elements which this CompositeElement encapsulates. Read-only.
+ This will not usually be accessed in developers' code, but developers wishing
+to augment the capabilities of the CompositeElementLite class may use it when adding
+methods to the class.
+ For example to add the nextAll method to the class to add all
+following siblings of selected elements, the code would be
+Ext.override(Ext.CompositeElementLite, {
+ nextAll: function() {
+ var els = this.elements, i, l = els.length, n, r = [], ri = -1;
+
+// Loop through all elements in this Composite, accumulating
+// an Array of all siblings.
+ for (i = 0; i < l; i++) {
+ for (n = els[i].nextSibling; n; n = n.nextSibling) {
+ r[++ri] = n;
+ }
+ }
+
+// Add all found siblings to this Composite
+ return this.add(r);
+ }
});
| CompositeElementLite |
Public Methods|
| ( Function fn , [Object scope ] )
:
- CompositeElementIterates each element in this composite
-calling the supplied function using Ext.each. Iterates each element in this composite
-calling the supplied function using Ext.each. Parameters:fn : FunctionThe function to be called with each
- element . If the supplied function returns false,
-iteration stops. This function is called with the following arguments:
- scope : Object(optional) The scope ( reference) in which the specified function is executed.
-Defaults to the element at the current index
+ CompositeElementIterates each element in this composite
+calling the supplied function using Ext.each. Iterates each element in this composite
+calling the supplied function using Ext.each.
| CompositeElement | | add( Mixed els )
:
CompositeElementAdds elements to this Composite object. Adds elements to this Composite object. Parameters:Returns:CompositeElement This Composite object.
| CompositeElementLite | | clear()
@@ -56,20 +57,20 @@ within the composite.Returns:Comp
:
BooleanReturns true if this composite contains the passed element Returns true if this composite contains the passed element
| CompositeElementLite | | each( Function fn , [Object scope ] )
:
- CompositeElementCalls the passed function for each element in this composite. Calls the passed function for each element in this composite. Parameters:fn : FunctionThe function to call. The function is passed the following parameters:
-- el : Element
The current Element in the iteration.
-This is the flyweight (shared) Ext.Element instance, so if you require a
-a reference to the dom node, use el.dom.
-- c : Composite
This Composite object.
-- idx : Number
The zero-based index in the iteration.
+ CompositeElementCalls the passed function for each element in this composite. Calls the passed function for each element in this composite.
| CompositeElementLite | | fill( Mixed els )
:
CompositeElementClears this Composite and adds the elements passed. Clears this Composite and adds the elements passed. | CompositeElementLite | | filter( String/Function selector )
:
- CompositeElementFilters this composite to only elements that match the passed selector. Filters this composite to only elements that match the passed selector. Parameters:selector : String/FunctionA string CSS selector or a comparison function.
-The comparison function will be called with the following arguments:
| CompositeElementLite | | first()
:
Ext.ElementReturns the first Element Returns the first Element | CompositeElementLite | | getCount()
@@ -82,8 +83,8 @@ The comparison function will be called with the following arguments: | CompositeElementLite | | removeElement( Mixed el , [Boolean removeDom ] )
:
- CompositeElementRemoves the specified element(s). Removes the specified element(s). Parameters:el : MixedThe id of an element, the Element itself, the index of the element in this composite
+ CompositeElement Removes the specified element(s). Removes the specified element(s). Parameters:el : MixedThe id of an element, the Element itself, the index of the element in this composite
or an array of any of those. removeDom : Boolean(optional) True to also remove the element from the document Returns:
| CompositeElementLite | | replaceElement( Mixed el , Mixed replacement , [Boolean domReplace ] )
:
- CompositeElementReplaces the specified element with the passed element. Replaces the specified element with the passed element. Parameters:el : MixedThe id of an element, the Element itself, the index of the element in this composite
+ CompositeElement Replaces the specified element with the passed element. Replaces the specified element with the passed element. Parameters:el : MixedThe id of an element, the Element itself, the index of the element in this composite
to replace. replacement : MixedThe id of an element or the Element itself. domReplace : Boolean(Optional) True to remove and replace the element in the document too. Returns:
| CompositeElementLite |
Public EventsThis class has no public events.
\ No newline at end of file
|