a59fab2014f3cb84a540dd43702e92a59c74adfe.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <div class="body-wrap">
  2. <div class="top-tools">
  3. <a class="inner-link" href="#Ext.QuickTips-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
  4. <a class="inner-link" href="#Ext.QuickTips-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
  5. <a class="inner-link" href="#Ext.QuickTips-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
  6. <a class="bookmark" href="../docs/?class=Ext.QuickTips"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
  7. </div>
  8. <h1>Class Ext.QuickTips</h1>
  9. <table cellspacing="0">
  10. <tr><td class="label">Package:</td><td class="hd-info">Ext</td></tr>
  11. <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/QuickTips.js" target="_blank">QuickTips.js</a></td></tr>
  12. <tr><td class="label">Class:</td><td class="hd-info">QuickTips</td></tr>
  13. <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr>
  14. </table>
  15. <div class="description">
  16. <p>Provides attractive and customizable tooltips for any element. The QuickTips
  17. singleton is used to configure and manage tooltips globally for multiple elements
  18. in a generic manner. To create individual tooltips with maximum customizability,
  19. you should consider either <a ext:cls="Ext.Tip" href="output/Ext.Tip.html">Ext.Tip</a> or <a ext:cls="Ext.ToolTip" href="output/Ext.ToolTip.html">Ext.ToolTip</a>.</p>
  20. <p>Quicktips can be configured via tag attributes directly in markup, or by
  21. registering quick tips programmatically via the <a ext:cls="Ext.QuickTips" ext:member="register" href="output/Ext.QuickTips.html#register">register</a> method.</p>
  22. <p>The singleton's instance of <a ext:cls="Ext.QuickTip" href="output/Ext.QuickTip.html">Ext.QuickTip</a> is available via
  23. <a ext:cls="Ext.QuickTips" ext:member="getQuickTip" href="output/Ext.QuickTips.html#getQuickTip">getQuickTip</a>, and supports all the methods, and all the all the
  24. configuration properties of Ext.QuickTip. These settings will apply to all
  25. tooltips shown by the singleton.</p>
  26. <p>Below is the summary of the configuration properties which can be used.
  27. For detailed descriptions see <a ext:cls="Ext.QuickTips" ext:member="getQuickTip" href="output/Ext.QuickTips.html#getQuickTip">getQuickTip</a></p>
  28. <p><b>QuickTips singleton configs (all are optional)</b></p>
  29. <div class="mdetail-params"><ul><li>dismissDelay</li>
  30. <li>hideDelay</li>
  31. <li>maxWidth</li>
  32. <li>minWidth</li>
  33. <li>showDelay</li>
  34. <li>trackMouse</li></ul></div>
  35. <p><b>Target element configs (optional unless otherwise noted)</b></p>
  36. <div class="mdetail-params"><ul><li>autoHide</li>
  37. <li>cls</li>
  38. <li>dismissDelay (overrides singleton value)</li>
  39. <li>target (required)</li>
  40. <li>text (required)</li>
  41. <li>title</li>
  42. <li>width</li></ul></div>
  43. <p>Here is an example showing how some of these config options could be used:</p>
  44. <pre><code><i>// Init the singleton. Any tag-based quick tips will start working.</i>
  45. Ext.QuickTips.init();
  46. <i>// Apply a set of config properties to the singleton</i>
  47. Ext.apply(Ext.QuickTips.getQuickTip(), {
  48. maxWidth: 200,
  49. minWidth: 100,
  50. showDelay: 50,
  51. trackMouse: true
  52. });
  53. <i>// Manually register a quick tip <b>for</b> a specific element</i>
  54. q.register({
  55. target: <em>'my-div'</em>,
  56. title: <em>'My Tooltip'</em>,
  57. text: <em>'This tooltip was added <b>in</b> code'</em>,
  58. width: 100,
  59. dismissDelay: 20
  60. });</code></pre>
  61. <p>To register a quick tip in markup, you simply add one or more of the valid QuickTip attributes prefixed with
  62. the <b>ext:</b> namespace. The HTML element itself is automatically set as the quick tip target. Here is the summary
  63. of supported attributes (optional unless otherwise noted):</p>
  64. <ul><li><b>hide</b>: Specifying "user" is equivalent to setting autoHide = false. Any other value will be the
  65. same as autoHide = true.</li>
  66. <li><b>qclass</b>: A CSS class to be applied to the quick tip (equivalent to the 'cls' target element config).</li>
  67. <li><b>qtip (required)</b>: The quick tip text (equivalent to the 'text' target element config).</li>
  68. <li><b>qtitle</b>: The quick tip title (equivalent to the 'title' target element config).</li>
  69. <li><b>qwidth</b>: The quick tip width (equivalent to the 'width' target element config).</li></ul>
  70. <p>Here is an example of configuring an HTML element to display a tooltip from markup:</p>
  71. <pre><code><i>// Add a quick tip to an HTML button</i>
  72. &lt;input type=<em>"button"</em> value=<em>"OK"</em> ext:qtitle=<em>"OK Button"</em> ext:qwidth=<em>"100"</em>
  73. ext:qtip=<em>"This is a quick tip from markup!"</em>>&lt;/input></code></pre><br><br><i>This class is a singleton and cannot be created directly.</i> </div>
  74. <div class="hr"></div>
  75. <a id="Ext.QuickTips-props"></a>
  76. <h2>Public Properties</h2>
  77. <div class="no-members">This class has no public properties.</div> <a id="Ext.QuickTips-methods"></a>
  78. <h2>Public Methods</h2>
  79. <table cellspacing="0" class="member-table">
  80. <tr>
  81. <th class="sig-header" colspan="2">Method</th>
  82. <th class="msource-header">Defined By</th>
  83. </tr>
  84. <tr class="method-row expandable">
  85. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  86. <td class="sig">
  87. <a id="Ext.QuickTips-disable"></a>
  88. <b>disable</b>() : void <div class="mdesc">
  89. <div class="short">Disable quick tips globally.</div>
  90. <div class="long">
  91. Disable quick tips globally. <div class="mdetail-params">
  92. <strong>Parameters:</strong>
  93. <ul><li>None.</li> </ul>
  94. <strong>Returns:</strong>
  95. <ul>
  96. <li><code>void</code></li>
  97. </ul>
  98. </div>
  99. </div>
  100. </div>
  101. </td>
  102. <td class="msource">QuickTips</td>
  103. </tr>
  104. <tr class="method-row alt expandable">
  105. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  106. <td class="sig">
  107. <a id="Ext.QuickTips-enable"></a>
  108. <b>enable</b>() : void <div class="mdesc">
  109. <div class="short">Enable quick tips globally.</div>
  110. <div class="long">
  111. Enable quick tips globally. <div class="mdetail-params">
  112. <strong>Parameters:</strong>
  113. <ul><li>None.</li> </ul>
  114. <strong>Returns:</strong>
  115. <ul>
  116. <li><code>void</code></li>
  117. </ul>
  118. </div>
  119. </div>
  120. </div>
  121. </td>
  122. <td class="msource">QuickTips</td>
  123. </tr>
  124. <tr class="method-row expandable">
  125. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  126. <td class="sig">
  127. <a id="Ext.QuickTips-getQuickTip"></a>
  128. <b>getQuickTip</b>() : void <div class="mdesc">
  129. <div class="short">Gets the global QuickTips instance.</div>
  130. <div class="long">
  131. Gets the global QuickTips instance. <div class="mdetail-params">
  132. <strong>Parameters:</strong>
  133. <ul><li>None.</li> </ul>
  134. <strong>Returns:</strong>
  135. <ul>
  136. <li><code>void</code></li>
  137. </ul>
  138. </div>
  139. </div>
  140. </div>
  141. </td>
  142. <td class="msource">QuickTips</td>
  143. </tr>
  144. <tr class="method-row alt expandable">
  145. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  146. <td class="sig">
  147. <a id="Ext.QuickTips-init"></a>
  148. <b>init</b>() : void <div class="mdesc">
  149. <div class="short">Initialize the global QuickTips instance and prepare any quick tips.</div>
  150. <div class="long">
  151. Initialize the global QuickTips instance and prepare any quick tips. <div class="mdetail-params">
  152. <strong>Parameters:</strong>
  153. <ul><li>None.</li> </ul>
  154. <strong>Returns:</strong>
  155. <ul>
  156. <li><code>void</code></li>
  157. </ul>
  158. </div>
  159. </div>
  160. </div>
  161. </td>
  162. <td class="msource">QuickTips</td>
  163. </tr>
  164. <tr class="method-row expandable">
  165. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  166. <td class="sig">
  167. <a id="Ext.QuickTips-isEnabled"></a>
  168. <b>isEnabled</b>() : Boolean <div class="mdesc">
  169. <div class="short">Returns true if quick tips are enabled, else false.</div>
  170. <div class="long">
  171. Returns true if quick tips are enabled, else false. <div class="mdetail-params">
  172. <strong>Parameters:</strong>
  173. <ul><li>None.</li> </ul>
  174. <strong>Returns:</strong>
  175. <ul>
  176. <li><code>Boolean</code></li>
  177. </ul>
  178. </div>
  179. </div>
  180. </div>
  181. </td>
  182. <td class="msource">QuickTips</td>
  183. </tr>
  184. <tr class="method-row alt expandable">
  185. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  186. <td class="sig">
  187. <a id="Ext.QuickTips-register"></a>
  188. <b>register</b>(&nbsp;<code>Object config</code>&nbsp;) : void <div class="mdesc">
  189. <div class="short">Configures a new quick tip instance and assigns it to a target element. See
  190. <a ext:cls="Ext.QuickTip" ext:member="register" href="output/Ext.QuickTip.html#register">Ext.QuickTip.register</a> for details.</div>
  191. <div class="long">
  192. Configures a new quick tip instance and assigns it to a target element. See
  193. <a ext:cls="Ext.QuickTip" ext:member="register" href="output/Ext.QuickTip.html#register">Ext.QuickTip.register</a> for details. <div class="mdetail-params">
  194. <strong>Parameters:</strong>
  195. <ul><li><code>config</code> : Object<div class="sub-desc">The config object</div></li> </ul>
  196. <strong>Returns:</strong>
  197. <ul>
  198. <li><code>void</code></li>
  199. </ul>
  200. </div>
  201. </div>
  202. </div>
  203. </td>
  204. <td class="msource">QuickTips</td>
  205. </tr>
  206. <tr class="method-row expandable">
  207. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  208. <td class="sig">
  209. <a id="Ext.QuickTips-tips"></a>
  210. <b>tips</b>(&nbsp;<code>Object config</code>&nbsp;) : void <div class="mdesc">
  211. <div class="short">Alias of <a ext:cls="Ext.QuickTips" ext:member="register" href="output/Ext.QuickTips.html#register">register</a>.</div>
  212. <div class="long">
  213. Alias of <a ext:cls="Ext.QuickTips" ext:member="register" href="output/Ext.QuickTips.html#register">register</a>. <div class="mdetail-params">
  214. <strong>Parameters:</strong>
  215. <ul><li><code>config</code> : Object<div class="sub-desc">The config object</div></li> </ul>
  216. <strong>Returns:</strong>
  217. <ul>
  218. <li><code>void</code></li>
  219. </ul>
  220. </div>
  221. </div>
  222. </div>
  223. </td>
  224. <td class="msource">QuickTips</td>
  225. </tr>
  226. <tr class="method-row alt expandable">
  227. <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
  228. <td class="sig">
  229. <a id="Ext.QuickTips-unregister"></a>
  230. <b>unregister</b>(&nbsp;<code>String/HTMLElement/Element el</code>&nbsp;) : void <div class="mdesc">
  231. <div class="short">Removes any registered quick tip from the target element and destroys it.</div>
  232. <div class="long">
  233. Removes any registered quick tip from the target element and destroys it. <div class="mdetail-params">
  234. <strong>Parameters:</strong>
  235. <ul><li><code>el</code> : String/HTMLElement/Element<div class="sub-desc">The element from which the quick tip is to be removed.</div></li> </ul>
  236. <strong>Returns:</strong>
  237. <ul>
  238. <li><code>void</code></li>
  239. </ul>
  240. </div>
  241. </div>
  242. </div>
  243. </td>
  244. <td class="msource">QuickTips</td>
  245. </tr>
  246. </table>
  247. <a id="Ext.QuickTips-events"></a>
  248. <h2>Public Events</h2>
  249. <div class="no-members">This class has no public events.</div>
  250. </div>