7fbf0a414792c65b8b27c74786aec937dabf610e.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <div class="body-wrap">
  2. <div class="top-tools">
  3. <a class="inner-link" href="#Ext.CompositeElementLite-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
  4. <a class="inner-link" href="#Ext.CompositeElementLite-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
  5. <a class="inner-link" href="#Ext.CompositeElementLite-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
  6. <a class="bookmark" href="../docs/?class=Ext.CompositeElementLite"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
  7. </div>
  8. <div class="inheritance res-block">
  9. <pre class="res-block-inner"><a ext:cls="Ext.CompositeElement" ext:member="" href="output/Ext.CompositeElement.html">CompositeElement</a>
  10. <img src="resources/elbow-end.gif"/>CompositeElementLite</pre></div>
  11. <h1>Class Ext.CompositeElementLite</h1>
  12. <table cellspacing="0">
  13. <tr><td class="label">Package:</td><td class="hd-info">Ext</td></tr>
  14. <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/CompositeElement.js" target="_blank">CompositeElement.js</a></td></tr>
  15. <tr><td class="label">Class:</td><td class="hd-info">CompositeElementLite</td></tr>
  16. <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.CompositeElement" ext:member="" href="output/Ext.CompositeElement.html">CompositeElement</a></td></tr>
  17. </table>
  18. <div class="description">
  19. Flyweight composite class. Reuses the same Ext.Element for element operations.
  20. <pre><code>var els = Ext.select(<em>"#some-el div.some-class"</em>);
  21. <i>// or select directly from an existing element</i>
  22. <b>var</b> el = Ext.get(<em>'some-el'</em>);
  23. el.select(<em>'div.some-class'</em>);
  24. els.setWidth(100); <i>// all elements become 100 width</i>
  25. els.hide(true); <i>// all elements fade out and hide</i>
  26. <i>// or</i>
  27. els.setWidth(100).hide(true);</code></pre><br><br>
  28. <b>NOTE: Although they are not listed, this class supports all of the set/update methods of Ext.Element. All Ext.Element
  29. actions will be performed on all the elements in this collection.</b> </div>
  30. <div class="hr"></div>
  31. <a id="Ext.CompositeElementLite-props"></a>
  32. <h2>Public Properties</h2>
  33. <div class="no-members">This class has no public properties.</div> <a id="Ext.CompositeElementLite-methods"></a>
  34. <h2>Public Methods</h2>
  35. <table cellspacing="0" class="member-table">
  36. <tr>
  37. <th class="sig-header" colspan="2">Method</th>
  38. <th class="msource-header">Defined By</th>
  39. </tr>
  40. <tr class="method-row inherited expandable">
  41. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  42. <td class="sig">
  43. <a id="Ext.CompositeElementLite-add"></a>
  44. <b>add</b>(&nbsp;<code>String/Array els</code>&nbsp;) : CompositeElement <div class="mdesc">
  45. <div class="short">Adds elements to this composite.</div>
  46. <div class="long">
  47. Adds elements to this composite. <div class="mdetail-params">
  48. <strong>Parameters:</strong>
  49. <ul><li><code>els</code> : String/Array<div class="sub-desc">A string CSS selector, an array of elements or an element</div></li> </ul>
  50. <strong>Returns:</strong>
  51. <ul>
  52. <li><code>CompositeElement</code><div class="sub-desc">this</div></li>
  53. </ul>
  54. </div>
  55. </div>
  56. </div>
  57. </td>
  58. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#add" href="output/Ext.CompositeElement.html#add">CompositeElement</a></td>
  59. </tr>
  60. <tr class="method-row inherited alt expandable">
  61. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  62. <td class="sig">
  63. <a id="Ext.CompositeElementLite-clear"></a>
  64. <b>clear</b>() : void <div class="mdesc">
  65. <div class="short">Removes all elements.</div>
  66. <div class="long">
  67. Removes all elements. <div class="mdetail-params">
  68. <strong>Parameters:</strong>
  69. <ul><li>None.</li> </ul>
  70. <strong>Returns:</strong>
  71. <ul>
  72. <li><code>void</code></li>
  73. </ul>
  74. </div>
  75. </div>
  76. </div>
  77. </td>
  78. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#clear" href="output/Ext.CompositeElement.html#clear">CompositeElement</a></td>
  79. </tr>
  80. <tr class="method-row inherited expandable">
  81. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  82. <td class="sig">
  83. <a id="Ext.CompositeElementLite-contains"></a>
  84. <b>contains</b>() : Boolean <div class="mdesc">
  85. <div class="short">Returns true if this composite contains the passed element</div>
  86. <div class="long">
  87. Returns true if this composite contains the passed element <div class="mdetail-params">
  88. <strong>Parameters:</strong>
  89. <ul><li>None.</li> </ul>
  90. <strong>Returns:</strong>
  91. <ul>
  92. <li><code>Boolean</code></li>
  93. </ul>
  94. </div>
  95. </div>
  96. </div>
  97. </td>
  98. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#contains" href="output/Ext.CompositeElement.html#contains">CompositeElement</a></td>
  99. </tr>
  100. <tr class="method-row alt expandable">
  101. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  102. <td class="sig">
  103. <a id="Ext.CompositeElementLite-each"></a>
  104. <b>each</b>(&nbsp;<code>Function fn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>&nbsp;) : CompositeElement <div class="mdesc">
  105. <div class="short">Calls the passed function passing (el, this, index) for each element in this composite. The element
  106. passed is the fly...</div>
  107. <div class="long">
  108. Calls the passed function passing (el, this, index) for each element in this composite. <b>The element
  109. passed is the flyweight (shared) Ext.Element instance, so if you require a
  110. a reference to the dom node, use el.dom.</b> <div class="mdetail-params">
  111. <strong>Parameters:</strong>
  112. <ul><li><code>fn</code> : Function<div class="sub-desc">The function to call</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The <i>this</i> object (defaults to the element)</div></li> </ul>
  113. <strong>Returns:</strong>
  114. <ul>
  115. <li><code>CompositeElement</code><div class="sub-desc">this</div></li>
  116. </ul>
  117. </div>
  118. </div>
  119. </div>
  120. </td>
  121. <td class="msource">CompositeElementLite</td>
  122. </tr>
  123. <tr class="method-row inherited expandable">
  124. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  125. <td class="sig">
  126. <a id="Ext.CompositeElementLite-fill"></a>
  127. <b>fill</b>(&nbsp;<code>String/Array els</code>&nbsp;) : CompositeElement <div class="mdesc">
  128. <div class="short">Clears this composite and adds the elements returned by the passed selector.</div>
  129. <div class="long">
  130. Clears this composite and adds the elements returned by the passed selector. <div class="mdetail-params">
  131. <strong>Parameters:</strong>
  132. <ul><li><code>els</code> : String/Array<div class="sub-desc">A string CSS selector, an array of elements or an element</div></li> </ul>
  133. <strong>Returns:</strong>
  134. <ul>
  135. <li><code>CompositeElement</code><div class="sub-desc">this</div></li>
  136. </ul>
  137. </div>
  138. </div>
  139. </div>
  140. </td>
  141. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#fill" href="output/Ext.CompositeElement.html#fill">CompositeElement</a></td>
  142. </tr>
  143. <tr class="method-row inherited alt expandable">
  144. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  145. <td class="sig">
  146. <a id="Ext.CompositeElementLite-filter"></a>
  147. <b>filter</b>(&nbsp;<code>String selector</code>&nbsp;) : CompositeElement <div class="mdesc">
  148. <div class="short">Filters this composite to only elements that match the passed selector.</div>
  149. <div class="long">
  150. Filters this composite to only elements that match the passed selector. <div class="mdetail-params">
  151. <strong>Parameters:</strong>
  152. <ul><li><code>selector</code> : String<div class="sub-desc">A string CSS selector</div></li> </ul>
  153. <strong>Returns:</strong>
  154. <ul>
  155. <li><code>CompositeElement</code><div class="sub-desc">this</div></li>
  156. </ul>
  157. </div>
  158. </div>
  159. </div>
  160. </td>
  161. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#filter" href="output/Ext.CompositeElement.html#filter">CompositeElement</a></td>
  162. </tr>
  163. <tr class="method-row inherited expandable">
  164. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  165. <td class="sig">
  166. <a id="Ext.CompositeElementLite-first"></a>
  167. <b>first</b>() : Ext.Element <div class="mdesc">
  168. <div class="short">Returns the first Element</div>
  169. <div class="long">
  170. Returns the first Element <div class="mdetail-params">
  171. <strong>Parameters:</strong>
  172. <ul><li>None.</li> </ul>
  173. <strong>Returns:</strong>
  174. <ul>
  175. <li><code>Ext.Element</code></li>
  176. </ul>
  177. </div>
  178. </div>
  179. </div>
  180. </td>
  181. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#first" href="output/Ext.CompositeElement.html#first">CompositeElement</a></td>
  182. </tr>
  183. <tr class="method-row inherited alt expandable">
  184. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  185. <td class="sig">
  186. <a id="Ext.CompositeElementLite-getCount"></a>
  187. <b>getCount</b>() : Number <div class="mdesc">
  188. <div class="short">Returns the number of elements in this composite</div>
  189. <div class="long">
  190. Returns the number of elements in this composite <div class="mdetail-params">
  191. <strong>Parameters:</strong>
  192. <ul><li>None.</li> </ul>
  193. <strong>Returns:</strong>
  194. <ul>
  195. <li><code>Number</code></li>
  196. </ul>
  197. </div>
  198. </div>
  199. </div>
  200. </td>
  201. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#getCount" href="output/Ext.CompositeElement.html#getCount">CompositeElement</a></td>
  202. </tr>
  203. <tr class="method-row inherited expandable">
  204. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  205. <td class="sig">
  206. <a id="Ext.CompositeElementLite-indexOf"></a>
  207. <b>indexOf</b>() : Boolean <div class="mdesc">
  208. <div class="short">Returns true if this composite contains the passed element</div>
  209. <div class="long">
  210. Returns true if this composite contains the passed element <div class="mdetail-params">
  211. <strong>Parameters:</strong>
  212. <ul><li>None.</li> </ul>
  213. <strong>Returns:</strong>
  214. <ul>
  215. <li><code>Boolean</code></li>
  216. </ul>
  217. </div>
  218. </div>
  219. </div>
  220. </td>
  221. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#indexOf" href="output/Ext.CompositeElement.html#indexOf">CompositeElement</a></td>
  222. </tr>
  223. <tr class="method-row alt expandable">
  224. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  225. <td class="sig">
  226. <a id="Ext.CompositeElementLite-item"></a>
  227. <b>item</b>(&nbsp;<code>Number index</code>&nbsp;) : Ext.Element <div class="mdesc">
  228. <div class="short">Returns a flyweight Element of the dom element object at the specified index</div>
  229. <div class="long">
  230. Returns a flyweight Element of the dom element object at the specified index <div class="mdetail-params">
  231. <strong>Parameters:</strong>
  232. <ul><li><code>index</code> : Number<div class="sub-desc"></div></li> </ul>
  233. <strong>Returns:</strong>
  234. <ul>
  235. <li><code>Ext.Element</code></li>
  236. </ul>
  237. </div>
  238. </div>
  239. </div>
  240. </td>
  241. <td class="msource">CompositeElementLite</td>
  242. </tr>
  243. <tr class="method-row inherited expandable">
  244. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  245. <td class="sig">
  246. <a id="Ext.CompositeElementLite-last"></a>
  247. <b>last</b>() : Ext.Element <div class="mdesc">
  248. <div class="short">Returns the last Element</div>
  249. <div class="long">
  250. Returns the last Element <div class="mdetail-params">
  251. <strong>Parameters:</strong>
  252. <ul><li>None.</li> </ul>
  253. <strong>Returns:</strong>
  254. <ul>
  255. <li><code>Ext.Element</code></li>
  256. </ul>
  257. </div>
  258. </div>
  259. </div>
  260. </td>
  261. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#last" href="output/Ext.CompositeElement.html#last">CompositeElement</a></td>
  262. </tr>
  263. <tr class="method-row inherited alt expandable">
  264. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  265. <td class="sig">
  266. <a id="Ext.CompositeElementLite-removeElement"></a>
  267. <b>removeElement</b>(&nbsp;<code>Mixed el</code>, <span class="optional" title="Optional">[<code>Boolean removeDom</code>]</span>&nbsp;) : CompositeElement <div class="mdesc">
  268. <div class="short">Removes the specified element(s).</div>
  269. <div class="long">
  270. Removes the specified element(s). <div class="mdetail-params">
  271. <strong>Parameters:</strong>
  272. <ul><li><code>el</code> : Mixed<div class="sub-desc">The id of an element, the Element itself, the index of the element in this composite
  273. or an array of any of those.</div></li><li><code>removeDom</code> : Boolean<div class="sub-desc">(optional) True to also remove the element from the document</div></li> </ul>
  274. <strong>Returns:</strong>
  275. <ul>
  276. <li><code>CompositeElement</code><div class="sub-desc">this</div></li>
  277. </ul>
  278. </div>
  279. </div>
  280. </div>
  281. </td>
  282. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#removeElement" href="output/Ext.CompositeElement.html#removeElement">CompositeElement</a></td>
  283. </tr>
  284. <tr class="method-row inherited expandable">
  285. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  286. <td class="sig">
  287. <a id="Ext.CompositeElementLite-replaceElement"></a>
  288. <b>replaceElement</b>(&nbsp;<code>Mixed el</code>, <code>Mixed replacement</code>, <span class="optional" title="Optional">[<code>Boolean domReplace</code>]</span>&nbsp;) : CompositeElement <div class="mdesc">
  289. <div class="short">Replaces the specified element with the passed element.</div>
  290. <div class="long">
  291. Replaces the specified element with the passed element. <div class="mdetail-params">
  292. <strong>Parameters:</strong>
  293. <ul><li><code>el</code> : Mixed<div class="sub-desc">The id of an element, the Element itself, the index of the element in this composite
  294. to replace.</div></li><li><code>replacement</code> : Mixed<div class="sub-desc">The id of an element or the Element itself.</div></li><li><code>domReplace</code> : Boolean<div class="sub-desc">(Optional) True to remove and replace the element in the document too.</div></li> </ul>
  295. <strong>Returns:</strong>
  296. <ul>
  297. <li><code>CompositeElement</code><div class="sub-desc">this</div></li>
  298. </ul>
  299. </div>
  300. </div>
  301. </div>
  302. </td>
  303. <td class="msource"><a ext:cls="Ext.CompositeElement" ext:member="#replaceElement" href="output/Ext.CompositeElement.html#replaceElement">CompositeElement</a></td>
  304. </tr>
  305. </table>
  306. <a id="Ext.CompositeElementLite-events"></a>
  307. <h2>Public Events</h2>
  308. <div class="no-members">This class has no public events.</div>
  309. </div>