Properties Methods Events Direct Link

    CompositeElement
      CompositeElementLite

# Class Ext.CompositeElementLite

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

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
--- | ---

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. The element passed is the fly...
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

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 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

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.