Properties Methods Events Direct Link

# Class Ext.CompositeElementLite

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

Flyweight composite class. Reuses the same Ext.Element for element operations.

    var els = Ext.select("#some-el div.some-class");
     // or select directly from an existing element

     var el = Ext.get('some-el');
     el.select('div.some-class');

     els.setWidth(100); // all elements become 100 width

     els.hide(true); // all elements fade out and hide

     // or

     els.setWidth(100).hide(true);

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.

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---
| clear() : void Removes all elements. Removes all elements. Parameters: None. Returns: void | CompositeElementLite
| each( `Function fn`, [`Object scope`] ) : CompositeElement Calls the passed function passing (el, this, index) for each element in this composite. The element passed is the fl... Calls the passed function passing (el, this, index) for each element in this composite. The element passed is the flyweight (shared) Ext.Element instance, so if you require a a reference to the dom node, use el.dom. Parameters: `fn` : Function The function to call `scope` : Object (optional) The this object (defaults to the element) Returns: `CompositeElement` this | CompositeElementLite
| getCount() : Number Returns the number of elements in this composite Returns the number of elements in this composite Parameters: None. Returns: `Number` | CompositeElementLite
| indexOf( `el {Mixed}` ) : Number Find the index of the passed element within the composite collection. Find the index of the passed element within the composite collection. Parameters: `{Mixed}` : el The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection. Returns: `Number` The index of the passed Ext.Element in the composite collection, or -1 if not found. | CompositeElementLite
| item( `Number index` ) : Ext.Element Returns a flyweight Element of the dom element object at the specified index Returns a flyweight Element of the dom element object at the specified index Parameters: `index` : Number Returns: `Ext.Element` | CompositeElementLite
| 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 | CompositeElementLite

## Public Events

This class has no public events.