Class Ext.CompositeElement
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);
Properties
-
Methods
-
Events
Public Properties
This class has no public properties.
Public Methods
|
add( String/Array els ) : CompositeElement |
CompositeElement |
Adds elements to this composite. |
|
clear() : void |
CompositeElement |
Removes all elements. |
|
contains() : Boolean |
CompositeElement |
Returns true if this composite contains the passed element |
|
each( Function fn , [Object scope ] ) : CompositeElement |
CompositeElement |
Calls the passed function passing (el, this, index) for each element in this composite. |
|
fill( String/Array els ) : CompositeElement |
CompositeElement |
Clears this composite and adds the elements returned by the passed selector. |
|
filter( String selector ) : CompositeElement |
CompositeElement |
Filters this composite to only elements that match the passed selector. |
|
first() : Ext.Element |
CompositeElement |
Returns the first Element |
|
getCount() : Number |
CompositeElement |
Returns the number of elements in this composite |
|
indexOf() : Boolean |
CompositeElement |
Returns true if this composite contains the passed element |
|
item( Number index ) : Ext.Element |
CompositeElement |
Returns the Element object at the specified index |
|
last() : Ext.Element |
CompositeElement |
Returns the last Element |
|
removeElement( Mixed el , [Boolean removeDom ] ) : CompositeElement |
CompositeElement |
Removes the specified element(s). |
|
replaceElement( String/HTMLElement/Element/Number el , String/HTMLElement/Element replacement , [Boolean domReplace ] ) : CompositeElement |
CompositeElement |
Replaces the specified element with the passed element. |
Public Events
This class has no public events.
Method Details
add
public function add( String/Array els
)
Adds elements to this composite.
This method is defined by CompositeElement.
clear
public function clear()
This method is defined by CompositeElement.
contains
public function contains()
Returns true if this composite contains the passed element
This method is defined by CompositeElement.
each
public function each( Function fn
, [Object scope
] )
Calls the passed function passing (el, this, index) for each element in this composite.
This method is defined by CompositeElement.
fill
public function fill( String/Array els
)
Clears this composite and adds the elements returned by the passed selector.
This method is defined by CompositeElement.
filter
public function filter( String selector
)
Filters this composite to only elements that match the passed selector.
Parameters:
selector
: StringA string CSS selector
Returns:
This method is defined by CompositeElement.
first
public function first()
Returns the first Element
This method is defined by CompositeElement.
getCount
public function getCount()
Returns the number of elements in this composite
This method is defined by CompositeElement.
indexOf
public function indexOf()
Returns true if this composite contains the passed element
This method is defined by CompositeElement.
item
public function item( Number index
)
Returns the Element object at the specified index
This method is defined by CompositeElement.
last
public function last()
This method is defined by CompositeElement.
removeElement
public function removeElement( Mixed el
, [Boolean removeDom
] )
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:
This method is defined by CompositeElement.
replaceElement
public function replaceElement( String/HTMLElement/Element/Number el
, String/HTMLElement/Element replacement
, [Boolean domReplace
] )
Replaces the specified element with the passed element.
Parameters:
el
: String/HTMLElement/Element/NumberThe id of an element, the Element itself, the index of the element in this composite
to replace.
replacement
: String/HTMLElement/ElementThe id of an element or the Element itself.
domReplace
: Boolean(Optional) True to remove and replace the element in the document too.
Returns:
This method is defined by CompositeElement.