d7c236f5b775070bdb5dd57feaed24d9af1f3eb1.svn-base 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <div class="body-wrap">
  2. <div class="top-tools">
  3. <a class="inner-link" href="#Function-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
  4. <a class="inner-link" href="#Function-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
  5. <a class="inner-link" href="#Function-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
  6. <a class="bookmark" href="../docs/?class=Function"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
  7. </div>
  8. <h1>Class Function</h1>
  9. <table cellspacing="0">
  10. <tr><td class="label">Package:</td><td class="hd-info">Global</td></tr>
  11. <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/Ext.js" target="_blank">Ext.js</a></td></tr>
  12. <tr><td class="label">Class:</td><td class="hd-info">Function</td></tr>
  13. <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr>
  14. </table>
  15. <div class="description">
  16. These functions are available on every Function object (any JavaScript function). </div>
  17. <div class="hr"></div>
  18. <a id="Function-props"></a>
  19. <h2>Public Properties</h2>
  20. <div class="no-members">This class has no public properties.</div> <a id="Function-methods"></a>
  21. <h2>Public Methods</h2>
  22. <table cellspacing="0" class="member-table">
  23. <tr>
  24. <th class="sig-header" colspan="2">Method</th>
  25. <th class="msource-header">Defined By</th>
  26. </tr>
  27. <tr class="method-row expandable">
  28. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  29. <td class="sig">
  30. <a id="Function-createCallback"></a>
  31. <b>createCallback</b>() : Function <div class="mdesc">
  32. <div class="short">Creates a callback that passes arguments[0], arguments[1], arguments[2], ...
  33. Call directly on any function. Example: ...</div>
  34. <div class="long">
  35. Creates a callback that passes arguments[0], arguments[1], arguments[2], ...
  36. Call directly on any function. Example: <code>myFunction.createCallback(myarg, myarg2)</code>
  37. Will create a function that is bound to those 2 args. <div class="mdetail-params">
  38. <strong>Parameters:</strong>
  39. <ul><li>None.</li> </ul>
  40. <strong>Returns:</strong>
  41. <ul>
  42. <li><code>Function</code><div class="sub-desc">The new function</div></li>
  43. </ul>
  44. </div>
  45. </div>
  46. </div>
  47. </td>
  48. <td class="msource">Function</td>
  49. </tr>
  50. <tr class="method-row alt expandable">
  51. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  52. <td class="sig">
  53. <a id="Function-createDelegate"></a>
  54. <b>createDelegate</b>(&nbsp;<span class="optional" title="Optional">[<code>Object obj</code>]</span>, <span class="optional" title="Optional">[<code>Array args</code>]</span>, <span class="optional" title="Optional">[<code>Boolean/Number appendArgs</code>]</span>&nbsp;) : Function <div class="mdesc">
  55. <div class="short">Creates a delegate (callback) that sets the scope to obj.
  56. Call directly on any function. Example: this.myFunction.cre...</div>
  57. <div class="long">
  58. Creates a delegate (callback) that sets the scope to obj.
  59. Call directly on any function. Example: <code>this.myFunction.createDelegate(this)</code>
  60. Will create a function that is automatically scoped to this. <div class="mdetail-params">
  61. <strong>Parameters:</strong>
  62. <ul><li><code>obj</code> : Object<div class="sub-desc">(optional) The object for which the scope is set</div></li><li><code>args</code> : Array<div class="sub-desc">(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)</div></li><li><code>appendArgs</code> : Boolean/Number<div class="sub-desc">(optional) if True args are appended to call args instead of overriding,
  63. if a number the args are inserted at the specified position</div></li> </ul>
  64. <strong>Returns:</strong>
  65. <ul>
  66. <li><code>Function</code><div class="sub-desc">The new function</div></li>
  67. </ul>
  68. </div>
  69. </div>
  70. </div>
  71. </td>
  72. <td class="msource">Function</td>
  73. </tr>
  74. <tr class="method-row expandable">
  75. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  76. <td class="sig">
  77. <a id="Function-createInterceptor"></a>
  78. <b>createInterceptor</b>(&nbsp;<code>Function fcn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>&nbsp;) : Function <div class="mdesc">
  79. <div class="short">Creates an interceptor function. The passed fcn is called before the original one. If it returns false, the original ...</div>
  80. <div class="long">
  81. Creates an interceptor function. The passed fcn is called before the original one. If it returns false, the original one is not called.
  82. The resulting function returns the results of the original function.
  83. The passed fcn is called with the parameters of the original function.
  84. @addon <div class="mdetail-params">
  85. <strong>Parameters:</strong>
  86. <ul><li><code>fcn</code> : Function<div class="sub-desc">The function to call before the original</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope of the passed fcn (Defaults to scope of original function or window)</div></li> </ul>
  87. <strong>Returns:</strong>
  88. <ul>
  89. <li><code>Function</code><div class="sub-desc">The new function</div></li>
  90. </ul>
  91. </div>
  92. </div>
  93. </div>
  94. </td>
  95. <td class="msource">Function</td>
  96. </tr>
  97. <tr class="method-row alt expandable">
  98. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  99. <td class="sig">
  100. <a id="Function-createSequence"></a>
  101. <b>createSequence</b>(&nbsp;<code>Function fcn</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>&nbsp;) : Function <div class="mdesc">
  102. <div class="short">Create a combined function call sequence of the original function + the passed function.
  103. The resulting function retur...</div>
  104. <div class="long">
  105. Create a combined function call sequence of the original function + the passed function.
  106. The resulting function returns the results of the original function.
  107. The passed fcn is called with the parameters of the original function <div class="mdetail-params">
  108. <strong>Parameters:</strong>
  109. <ul><li><code>fcn</code> : Function<div class="sub-desc">The function to sequence</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope of the passed fcn (Defaults to scope of original function or window)</div></li> </ul>
  110. <strong>Returns:</strong>
  111. <ul>
  112. <li><code>Function</code><div class="sub-desc">The new function</div></li>
  113. </ul>
  114. </div>
  115. </div>
  116. </div>
  117. </td>
  118. <td class="msource">Function</td>
  119. </tr>
  120. <tr class="method-row expandable">
  121. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  122. <td class="sig">
  123. <a id="Function-defer"></a>
  124. <b>defer</b>(&nbsp;<code>Number millis</code>, <span class="optional" title="Optional">[<code>Object obj</code>]</span>, <span class="optional" title="Optional">[<code>Array args</code>]</span>, <span class="optional" title="Optional">[<code>Boolean/Number appendArgs</code>]</span>&nbsp;) : Number <div class="mdesc">
  125. <div class="short">Calls this function after the number of millseconds specified.</div>
  126. <div class="long">
  127. Calls this function after the number of millseconds specified. <div class="mdetail-params">
  128. <strong>Parameters:</strong>
  129. <ul><li><code>millis</code> : Number<div class="sub-desc">The number of milliseconds for the setTimeout call (if 0 the function is executed immediately)</div></li><li><code>obj</code> : Object<div class="sub-desc">(optional) The object for which the scope is set</div></li><li><code>args</code> : Array<div class="sub-desc">(optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)</div></li><li><code>appendArgs</code> : Boolean/Number<div class="sub-desc">(optional) if True args are appended to call args instead of overriding,
  130. if a number the args are inserted at the specified position</div></li> </ul>
  131. <strong>Returns:</strong>
  132. <ul>
  133. <li><code>Number</code><div class="sub-desc">The timeout id that can be used with clearTimeout</div></li>
  134. </ul>
  135. </div>
  136. </div>
  137. </div>
  138. </td>
  139. <td class="msource">Function</td>
  140. </tr>
  141. </table>
  142. <a id="Function-events"></a>
  143. <h2>Public Events</h2>
  144. <div class="no-members">This class has no public events.</div>
  145. </div>