3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
8 * @class Ext.CompositeElementLite
\r
10 Ext.apply(Ext.CompositeElementLite.prototype, {
\r
11 addElements : function(els, root){
\r
15 if(typeof els == "string"){
\r
16 els = Ext.Element.selectorFunction(els, root);
\r
18 var yels = this.elements;
\r
19 Ext.each(els, function(e) {
\r
20 yels.push(Ext.get(e));
\r
26 * Clears this composite and adds the elements returned by the passed selector.
\r
27 * @param {String/Array} els A string CSS selector, an array of elements or an element
\r
28 * @return {CompositeElement} this
\r
30 fill : function(els){
\r
37 * Returns the first Element
\r
38 * @return {Ext.Element}
\r
41 return this.item(0);
\r
45 * Returns the last Element
\r
46 * @return {Ext.Element}
\r
49 return this.item(this.getCount()-1);
\r
53 * Returns true if this composite contains the passed element
\r
54 * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
\r
57 contains : function(el){
\r
58 return this.indexOf(el) != -1;
\r
62 * Filters this composite to only elements that match the passed selector.
\r
63 * @param {String} selector A string CSS selector
\r
64 * @return {CompositeElement} this
\r
66 filter : function(selector){
\r
68 this.each(function(el){
\r
69 if(el.is(selector)){
\r
70 els[els.length] = el.dom;
\r
78 * Removes the specified element(s).
\r
79 * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite
\r
80 * or an array of any of those.
\r
81 * @param {Boolean} removeDom (optional) True to also remove the element from the document
\r
82 * @return {CompositeElement} this
\r
84 removeElement : function(keys, removeDom){
\r
86 els = this.elements,
\r
88 Ext.each(keys, function(val){
\r
89 if ((el = (els[val] || els[val = me.indexOf(val)]))) {
\r
97 els.splice(val, 1);
\r