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
|
add( String/Array els ) : CompositeElement
Adds elements to this composite.
Adds elements to this composite.
|
CompositeElement |
|
clear() : void
|
CompositeElement |
|
contains( el {Mixed} ) : Boolean
Returns true if this composite contains the passed element
Returns true if this composite contains the passed element
|
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.
|
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.
|
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 : StringA string CSS selector
Returns:
|
CompositeElement |
|
first() : Ext.Element
Returns the first Element
Returns the first Element
|
CompositeElement |
|
getCount() : Number
Returns the number of elements in this composite
Returns the number of elements in this composite
|
CompositeElement |
|
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.
|
CompositeElement |
|
item( Number index ) : Ext.Element
Returns the Element object at the specified index
Returns the Element object at the specified index
|
CompositeElement |
|
last() : Ext.Element
|
CompositeElement |
|
removeElement( Mixed el , [Boolean removeDom ] ) : 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:
|
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 : 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:
|
CompositeElement |
Public Events
This class has no public events.