3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
14 <div id="cls-Ext.CompositeElementLite"></div>/**
\r
15 * @class Ext.CompositeElementLite
\r
17 Ext.apply(Ext.CompositeElementLite.prototype, {
\r
18 addElements : function(els, root){
\r
22 if(typeof els == "string"){
\r
23 els = Ext.Element.selectorFunction(els, root);
\r
25 var yels = this.elements;
\r
26 Ext.each(els, function(e) {
\r
27 yels.push(Ext.get(e));
\r
32 <div id="method-Ext.CompositeElementLite-first"></div>/**
\r
33 * Returns the first Element
\r
34 * @return {Ext.Element}
\r
37 return this.item(0);
\r
40 <div id="method-Ext.CompositeElementLite-last"></div>/**
\r
41 * Returns the last Element
\r
42 * @return {Ext.Element}
\r
45 return this.item(this.getCount()-1);
\r
48 <div id="method-Ext.CompositeElementLite-contains"></div>/**
\r
49 * Returns true if this composite contains the passed element
\r
50 * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
\r
53 contains : function(el){
\r
54 return this.indexOf(el) != -1;
\r
57 <div id="method-Ext.CompositeElementLite-removeElement"></div>/**
\r
58 * Removes the specified element(s).
\r
59 * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite
\r
60 * or an array of any of those.
\r
61 * @param {Boolean} removeDom (optional) True to also remove the element from the document
\r
62 * @return {CompositeElement} this
\r
64 removeElement : function(keys, removeDom){
\r
66 els = this.elements,
\r
68 Ext.each(keys, function(val){
\r
69 if ((el = (els[val] || els[val = me.indexOf(val)]))) {
\r
77 els.splice(val, 1);
\r