3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">/**
\r
9 * @class Ext.CompositeElementLite
\r
11 Ext.apply(Ext.CompositeElementLite.prototype, {
\r
12 addElements : function(els, root){
\r
16 if(typeof els == "string"){
\r
17 els = Ext.Element.selectorFunction(els, root);
\r
19 var yels = this.elements;
\r
20 Ext.each(els, function(e) {
\r
21 yels.push(Ext.get(e));
\r
26 <div id="method-Ext.CompositeElementLite-fill"></div>/**
\r
27 * Clears this composite and adds the elements returned by the passed selector.
\r
28 * @param {String/Array} els A string CSS selector, an array of elements or an element
\r
29 * @return {CompositeElement} this
\r
31 fill : function(els){
\r
37 <div id="method-Ext.CompositeElementLite-first"></div>/**
\r
38 * Returns the first Element
\r
39 * @return {Ext.Element}
\r
42 return this.item(0);
\r
45 <div id="method-Ext.CompositeElementLite-last"></div>/**
\r
46 * Returns the last Element
\r
47 * @return {Ext.Element}
\r
50 return this.item(this.getCount()-1);
\r
53 <div id="method-Ext.CompositeElementLite-contains"></div>/**
\r
54 * Returns true if this composite contains the passed element
\r
55 * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
\r
58 contains : function(el){
\r
59 return this.indexOf(el) != -1;
\r
62 <div id="method-Ext.CompositeElementLite-filter"></div>/**
\r
63 * Filters this composite to only elements that match the passed selector.
\r
64 * @param {String} selector A string CSS selector
\r
65 * @return {CompositeElement} this
\r
67 filter : function(selector){
\r
69 this.each(function(el){
\r
70 if(el.is(selector)){
\r
71 els[els.length] = el.dom;
\r
78 <div id="method-Ext.CompositeElementLite-removeElement"></div>/**
\r
79 * Removes the specified element(s).
\r
80 * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite
\r
81 * or an array of any of those.
\r
82 * @param {Boolean} removeDom (optional) True to also remove the element from the document
\r
83 * @return {CompositeElement} this
\r
85 removeElement : function(keys, removeDom){
\r
87 els = this.elements,
\r
89 Ext.each(keys, function(val){
\r
90 if ((el = (els[val] || els[val = me.indexOf(val)]))) {
\r
98 els.splice(val, 1);
\r