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 * Returns the first Element
\r
27 * @return {Ext.Element}
\r
30 return this.item(0);
\r
34 * Returns the last Element
\r
35 * @return {Ext.Element}
\r
38 return this.item(this.getCount()-1);
\r
42 * Returns true if this composite contains the passed element
\r
43 * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
\r
46 contains : function(el){
\r
47 return this.indexOf(el) != -1;
\r
51 * Removes the specified element(s).
\r
52 * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite
\r
53 * or an array of any of those.
\r
54 * @param {Boolean} removeDom (optional) True to also remove the element from the document
\r
55 * @return {CompositeElement} this
\r
57 removeElement : function(keys, removeDom){
\r
59 els = this.elements,
\r
61 Ext.each(keys, function(val){
\r
62 if ((el = (els[val] || els[val = me.indexOf(val)]))) {
\r
70 els.splice(val, 1);
\r