Properties Methods Events Direct Link

# Class Ext.CompositeElement

Package: | Ext
Defined In: | CompositeElement.js
Class: | CompositeElement
Subclasses: | CompositeElementLite
Extends: | Object

Standard composite class. Creates a Ext.Element for every element in the collection.
NOTE: Although they are not listed, this class supports all of the set/update methods of Ext.Element. All Ext.Element actions will be performed on all the elements in this collection.
All methods return this and can be chained.

    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

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| add( `String/Array els` ) : CompositeElement Adds elements to this composite. Adds elements to this composite. Parameters: `els` : String/Array A string CSS selector, an array of elements or an element Returns: `CompositeElement` this | CompositeElement
| clear() : void Removes all elements. Removes all elements. Parameters: None. Returns: `void` | CompositeElement
| contains() : Boolean Returns true if this composite contains the passed element Returns true if this composite contains the passed element Parameters: None. Returns: `Boolean` | CompositeElement
| each( `Function fn`, [`Object scope`] ) : CompositeElement Calls the passed function passing (el, this, index) for each element in this composite. Calls the passed function passing (el, this, index) for each element in this composite. Parameters: `fn` : Function The function to call `scope` : Object (optional) The this object (defaults to the element) Returns: `CompositeElement` this | CompositeElement
| fill( `String/Array els` ) : CompositeElement Clears this composite and adds the elements returned by the passed selector. Clears this composite and adds the elements returned by the passed selector. Parameters: `els` : String/Array A string CSS selector, an array of elements or an element Returns: `CompositeElement` this | CompositeElement
| filter( `String selector` ) : CompositeElement Filters this composite to only elements that match the passed selector. Filters this composite to only elements that match the passed selector. Parameters: `selector` : String A string CSS selector Returns: `CompositeElement` this | CompositeElement
| first() : Ext.Element Returns the first Element Returns the first Element Parameters: None. Returns: `Ext.Element` | CompositeElement
| getCount() : Number Returns the number of elements in this composite Returns the number of elements in this composite Parameters: None. Returns: `Number` | CompositeElement
| indexOf() : Boolean Returns true if this composite contains the passed element Returns true if this composite contains the passed element Parameters: None. Returns: `Boolean` | CompositeElement
| item( `Number index` ) : Ext.Element Returns the Element object at the specified index Returns the Element object at the specified index Parameters: `index` : Number Returns: `Ext.Element` | CompositeElement
| last() : Ext.Element Returns the last Element Returns the last Element Parameters: None. Returns: `Ext.Element` | CompositeElement
| removeElement( `Mixed el`, [`Boolean removeDom`] ) : CompositeElement Removes the specified element(s). Removes the specified element(s). Parameters: `el` : Mixed The 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: `CompositeElement` this | CompositeElement
| replaceElement( `Mixed el`, `Mixed replacement`, [`Boolean domReplace`] ) : CompositeElement Replaces the specified element with the passed element. Replaces the specified element with the passed element. Parameters: `el` : Mixed The id of an element, the Element itself, the index of the element in this composite to replace. `replacement` : Mixed The id of an element or the Element itself. `domReplace` : Boolean (Optional) True to remove and replace the element in the document too. Returns: `CompositeElement` this | CompositeElement

## Public Events

This class has no public events.