1 | <div class="body-wrap"> |
---|
2 | <div class="top-tools"> |
---|
3 | <a class="inner-link" href="#Ext.MessageBox-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a> |
---|
4 | <a class="inner-link" href="#Ext.MessageBox-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a> |
---|
5 | <a class="inner-link" href="#Ext.MessageBox-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a> |
---|
6 | <a class="bookmark" href="../docs/?class=Ext.MessageBox"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a> |
---|
7 | </div> |
---|
8 | <h1>Class Ext.MessageBox</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/MessageBox.js" target="_blank">MessageBox.js</a></td></tr> |
---|
12 | <tr><td class="label">Class:</td><td class="hd-info">MessageBox</td></tr> |
---|
13 | <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr> |
---|
14 | </table> |
---|
15 | <div class="description"> |
---|
16 | * |
---|
17 | <p>Utility class for generating different styles of message boxes. The alias Ext.Msg can also be used.<p/> |
---|
18 | <p>Note that the MessageBox is asynchronous. Unlike a regular JavaScript <code>alert</code> (which will halt |
---|
19 | browser execution), showing a MessageBox will not cause the code to stop. For this reason, if you have code |
---|
20 | that should only run <em>after</em> some user feedback from the MessageBox, you must use a callback function |
---|
21 | (see the <code>function</code> parameter for <a ext:cls="Ext.MessageBox" ext:member="show" href="output/Ext.MessageBox.html#show">show</a> for more details).</p> |
---|
22 | <p>Example usage:</p> |
---|
23 | <pre><code><i>// Basic alert:</i> |
---|
24 | Ext.Msg.alert(<em>'Status'</em>, <em>'Changes saved successfully.'</em>); |
---|
25 | |
---|
26 | <i>// Prompt <b>for</b> user data and process the result using a callback:</i> |
---|
27 | Ext.Msg.prompt(<em>'Name'</em>, <em>'Please enter your name:'</em>, <b>function</b>(btn, text){ |
---|
28 | <b>if</b> (btn == <em>'ok'</em>){ |
---|
29 | <i>// process text value and close...</i> |
---|
30 | } |
---|
31 | }); |
---|
32 | |
---|
33 | <i>// Show a dialog using config options:</i> |
---|
34 | Ext.Msg.show({ |
---|
35 | title:<em>'Save Changes?'</em>, |
---|
36 | msg: <em>'You are closing a tab that has unsaved changes. Would you like to save your changes?'</em>, |
---|
37 | buttons: Ext.Msg.YESNOCANCEL, |
---|
38 | fn: processResult, |
---|
39 | animEl: <em>'elId'</em>, |
---|
40 | icon: Ext.MessageBox.QUESTION |
---|
41 | });</code></pre><br><br><i>This class is a singleton and cannot be created directly.</i> </div> |
---|
42 | |
---|
43 | <div class="hr"></div> |
---|
44 | <a id="Ext.MessageBox-props"></a> |
---|
45 | <h2>Public Properties</h2> |
---|
46 | <table cellspacing="0" class="member-table"> |
---|
47 | <tr> |
---|
48 | <th class="sig-header" colspan="2">Property</th> |
---|
49 | <th class="msource-header">Defined By</th> |
---|
50 | </tr> |
---|
51 | <tr class="property-row"> |
---|
52 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
53 | <td class="sig"> |
---|
54 | <a id="Ext.MessageBox-CANCEL"></a> |
---|
55 | <b>CANCEL</b> : Object <div class="mdesc"> |
---|
56 | Button config that displays a single Cancel button </div> |
---|
57 | </td> |
---|
58 | <td class="msource">MessageBox</td> |
---|
59 | </tr> |
---|
60 | <tr class="property-row alt"> |
---|
61 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
62 | <td class="sig"> |
---|
63 | <a id="Ext.MessageBox-ERROR"></a> |
---|
64 | <b>ERROR</b> : String <div class="mdesc"> |
---|
65 | The CSS class that provides the ERROR icon image </div> |
---|
66 | </td> |
---|
67 | <td class="msource">MessageBox</td> |
---|
68 | </tr> |
---|
69 | <tr class="property-row"> |
---|
70 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
71 | <td class="sig"> |
---|
72 | <a id="Ext.MessageBox-INFO"></a> |
---|
73 | <b>INFO</b> : String <div class="mdesc"> |
---|
74 | The CSS class that provides the INFO icon image </div> |
---|
75 | </td> |
---|
76 | <td class="msource">MessageBox</td> |
---|
77 | </tr> |
---|
78 | <tr class="property-row alt"> |
---|
79 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
80 | <td class="sig"> |
---|
81 | <a id="Ext.MessageBox-OK"></a> |
---|
82 | <b>OK</b> : Object <div class="mdesc"> |
---|
83 | Button config that displays a single OK button </div> |
---|
84 | </td> |
---|
85 | <td class="msource">MessageBox</td> |
---|
86 | </tr> |
---|
87 | <tr class="property-row"> |
---|
88 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
89 | <td class="sig"> |
---|
90 | <a id="Ext.MessageBox-OKCANCEL"></a> |
---|
91 | <b>OKCANCEL</b> : Object <div class="mdesc"> |
---|
92 | Button config that displays OK and Cancel buttons </div> |
---|
93 | </td> |
---|
94 | <td class="msource">MessageBox</td> |
---|
95 | </tr> |
---|
96 | <tr class="property-row alt"> |
---|
97 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
98 | <td class="sig"> |
---|
99 | <a id="Ext.MessageBox-QUESTION"></a> |
---|
100 | <b>QUESTION</b> : String <div class="mdesc"> |
---|
101 | The CSS class that provides the QUESTION icon image </div> |
---|
102 | </td> |
---|
103 | <td class="msource">MessageBox</td> |
---|
104 | </tr> |
---|
105 | <tr class="property-row"> |
---|
106 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
107 | <td class="sig"> |
---|
108 | <a id="Ext.MessageBox-WARNING"></a> |
---|
109 | <b>WARNING</b> : String <div class="mdesc"> |
---|
110 | The CSS class that provides the WARNING icon image </div> |
---|
111 | </td> |
---|
112 | <td class="msource">MessageBox</td> |
---|
113 | </tr> |
---|
114 | <tr class="property-row alt"> |
---|
115 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
116 | <td class="sig"> |
---|
117 | <a id="Ext.MessageBox-YESNO"></a> |
---|
118 | <b>YESNO</b> : Object <div class="mdesc"> |
---|
119 | Button config that displays Yes and No buttons </div> |
---|
120 | </td> |
---|
121 | <td class="msource">MessageBox</td> |
---|
122 | </tr> |
---|
123 | <tr class="property-row"> |
---|
124 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
125 | <td class="sig"> |
---|
126 | <a id="Ext.MessageBox-YESNOCANCEL"></a> |
---|
127 | <b>YESNOCANCEL</b> : Object <div class="mdesc"> |
---|
128 | Button config that displays Yes, No and Cancel buttons </div> |
---|
129 | </td> |
---|
130 | <td class="msource">MessageBox</td> |
---|
131 | </tr> |
---|
132 | <tr class="property-row alt expandable"> |
---|
133 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
134 | <td class="sig"> |
---|
135 | <a id="Ext.MessageBox-buttonText"></a> |
---|
136 | <b>buttonText</b> : Object <div class="mdesc"> |
---|
137 | <div class="short">An object containing the default button text strings that can be overriden for localized language support. |
---|
138 | Supported ...</div> |
---|
139 | <div class="long"> |
---|
140 | An object containing the default button text strings that can be overriden for localized language support. |
---|
141 | Supported properties are: ok, cancel, yes and no. Generally you should include a locale-specific |
---|
142 | resource file for handling language support across the framework. |
---|
143 | Customize the default text like so: Ext.MessageBox.buttonText.yes = "oui"; //french </div> |
---|
144 | </div> |
---|
145 | </td> |
---|
146 | <td class="msource">MessageBox</td> |
---|
147 | </tr> |
---|
148 | <tr class="property-row"> |
---|
149 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
150 | <td class="sig"> |
---|
151 | <a id="Ext.MessageBox-defaultTextHeight"></a> |
---|
152 | <b>defaultTextHeight</b> : Number <div class="mdesc"> |
---|
153 | The default height in pixels of the message box's multiline textarea if displayed (defaults to 75) </div> |
---|
154 | </td> |
---|
155 | <td class="msource">MessageBox</td> |
---|
156 | </tr> |
---|
157 | <tr class="property-row alt"> |
---|
158 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
159 | <td class="sig"> |
---|
160 | <a id="Ext.MessageBox-maxWidth"></a> |
---|
161 | <b>maxWidth</b> : Number <div class="mdesc"> |
---|
162 | The maximum width in pixels of the message box (defaults to 600) </div> |
---|
163 | </td> |
---|
164 | <td class="msource">MessageBox</td> |
---|
165 | </tr> |
---|
166 | <tr class="property-row expandable"> |
---|
167 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
168 | <td class="sig"> |
---|
169 | <a id="Ext.MessageBox-minProgressWidth"></a> |
---|
170 | <b>minProgressWidth</b> : Number <div class="mdesc"> |
---|
171 | <div class="short">The minimum width in pixels of the message box if it is a progress-style dialog. This is useful |
---|
172 | for setting a differ...</div> |
---|
173 | <div class="long"> |
---|
174 | The minimum width in pixels of the message box if it is a progress-style dialog. This is useful |
---|
175 | for setting a different minimum width than text-only dialogs may need (defaults to 250) </div> |
---|
176 | </div> |
---|
177 | </td> |
---|
178 | <td class="msource">MessageBox</td> |
---|
179 | </tr> |
---|
180 | <tr class="property-row alt"> |
---|
181 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
182 | <td class="sig"> |
---|
183 | <a id="Ext.MessageBox-minWidth"></a> |
---|
184 | <b>minWidth</b> : Number <div class="mdesc"> |
---|
185 | The minimum width in pixels of the message box (defaults to 100) </div> |
---|
186 | </td> |
---|
187 | <td class="msource">MessageBox</td> |
---|
188 | </tr> |
---|
189 | </table> |
---|
190 | <a id="Ext.MessageBox-methods"></a> |
---|
191 | <h2>Public Methods</h2> |
---|
192 | <table cellspacing="0" class="member-table"> |
---|
193 | <tr> |
---|
194 | <th class="sig-header" colspan="2">Method</th> |
---|
195 | <th class="msource-header">Defined By</th> |
---|
196 | </tr> |
---|
197 | <tr class="method-row expandable"> |
---|
198 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
199 | <td class="sig"> |
---|
200 | <a id="Ext.MessageBox-alert"></a> |
---|
201 | <b>alert</b>( <code>String title</code>, <code>String msg</code>, <span class="optional" title="Optional">[<code>Function fn</code>]</span>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : Ext.MessageBox <div class="mdesc"> |
---|
202 | <div class="short">Displays a standard read-only message box with an OK button (comparable to the basic JavaScript alert prompt). |
---|
203 | If a c...</div> |
---|
204 | <div class="long"> |
---|
205 | Displays a standard read-only message box with an OK button (comparable to the basic JavaScript alert prompt). |
---|
206 | If a callback function is passed it will be called after the user clicks the button, and the |
---|
207 | id of the button that was clicked will be passed as the only parameter to the callback |
---|
208 | (could also be the top-right close button). <div class="mdetail-params"> |
---|
209 | <strong>Parameters:</strong> |
---|
210 | <ul><li><code>title</code> : String<div class="sub-desc">The title bar text</div></li><li><code>msg</code> : String<div class="sub-desc">The message box body text</div></li><li><code>fn</code> : Function<div class="sub-desc">(optional) The callback function invoked after the message box is closed</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope of the callback function</div></li> </ul> |
---|
211 | <strong>Returns:</strong> |
---|
212 | <ul> |
---|
213 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
214 | </ul> |
---|
215 | </div> |
---|
216 | </div> |
---|
217 | </div> |
---|
218 | </td> |
---|
219 | <td class="msource">MessageBox</td> |
---|
220 | </tr> |
---|
221 | <tr class="method-row alt expandable"> |
---|
222 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
223 | <td class="sig"> |
---|
224 | <a id="Ext.MessageBox-confirm"></a> |
---|
225 | <b>confirm</b>( <code>String title</code>, <code>String msg</code>, <span class="optional" title="Optional">[<code>Function fn</code>]</span>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : Ext.MessageBox <div class="mdesc"> |
---|
226 | <div class="short">Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm). |
---|
227 | If a callback funct...</div> |
---|
228 | <div class="long"> |
---|
229 | Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm). |
---|
230 | If a callback function is passed it will be called after the user clicks either button, |
---|
231 | and the id of the button that was clicked will be passed as the only parameter to the callback |
---|
232 | (could also be the top-right close button). <div class="mdetail-params"> |
---|
233 | <strong>Parameters:</strong> |
---|
234 | <ul><li><code>title</code> : String<div class="sub-desc">The title bar text</div></li><li><code>msg</code> : String<div class="sub-desc">The message box body text</div></li><li><code>fn</code> : Function<div class="sub-desc">(optional) The callback function invoked after the message box is closed</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope of the callback function</div></li> </ul> |
---|
235 | <strong>Returns:</strong> |
---|
236 | <ul> |
---|
237 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
238 | </ul> |
---|
239 | </div> |
---|
240 | </div> |
---|
241 | </div> |
---|
242 | </td> |
---|
243 | <td class="msource">MessageBox</td> |
---|
244 | </tr> |
---|
245 | <tr class="method-row expandable"> |
---|
246 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
247 | <td class="sig"> |
---|
248 | <a id="Ext.MessageBox-getDialog"></a> |
---|
249 | <b>getDialog</b>() : Ext.Window <div class="mdesc"> |
---|
250 | <div class="short">Returns a reference to the underlying <a ext:cls="Ext.Window" href="output/Ext.Window.html">Ext.Window</a> element</div> |
---|
251 | <div class="long"> |
---|
252 | Returns a reference to the underlying <a ext:cls="Ext.Window" href="output/Ext.Window.html">Ext.Window</a> element <div class="mdetail-params"> |
---|
253 | <strong>Parameters:</strong> |
---|
254 | <ul><li>None.</li> </ul> |
---|
255 | <strong>Returns:</strong> |
---|
256 | <ul> |
---|
257 | <li><code>Ext.Window</code><div class="sub-desc">The window</div></li> |
---|
258 | </ul> |
---|
259 | </div> |
---|
260 | </div> |
---|
261 | </div> |
---|
262 | </td> |
---|
263 | <td class="msource">MessageBox</td> |
---|
264 | </tr> |
---|
265 | <tr class="method-row alt expandable"> |
---|
266 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
267 | <td class="sig"> |
---|
268 | <a id="Ext.MessageBox-hide"></a> |
---|
269 | <b>hide</b>() : Ext.MessageBox <div class="mdesc"> |
---|
270 | <div class="short">Hides the message box if it is displayed</div> |
---|
271 | <div class="long"> |
---|
272 | Hides the message box if it is displayed <div class="mdetail-params"> |
---|
273 | <strong>Parameters:</strong> |
---|
274 | <ul><li>None.</li> </ul> |
---|
275 | <strong>Returns:</strong> |
---|
276 | <ul> |
---|
277 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
278 | </ul> |
---|
279 | </div> |
---|
280 | </div> |
---|
281 | </div> |
---|
282 | </td> |
---|
283 | <td class="msource">MessageBox</td> |
---|
284 | </tr> |
---|
285 | <tr class="method-row expandable"> |
---|
286 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
287 | <td class="sig"> |
---|
288 | <a id="Ext.MessageBox-isVisible"></a> |
---|
289 | <b>isVisible</b>() : Boolean <div class="mdesc"> |
---|
290 | <div class="short">Returns true if the message box is currently displayed</div> |
---|
291 | <div class="long"> |
---|
292 | Returns true if the message box is currently displayed <div class="mdetail-params"> |
---|
293 | <strong>Parameters:</strong> |
---|
294 | <ul><li>None.</li> </ul> |
---|
295 | <strong>Returns:</strong> |
---|
296 | <ul> |
---|
297 | <li><code>Boolean</code><div class="sub-desc">True if the message box is visible, else false</div></li> |
---|
298 | </ul> |
---|
299 | </div> |
---|
300 | </div> |
---|
301 | </div> |
---|
302 | </td> |
---|
303 | <td class="msource">MessageBox</td> |
---|
304 | </tr> |
---|
305 | <tr class="method-row alt expandable"> |
---|
306 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
307 | <td class="sig"> |
---|
308 | <a id="Ext.MessageBox-progress"></a> |
---|
309 | <b>progress</b>( <code>String title</code>, <code>String msg</code>, <span class="optional" title="Optional">[<code>String progressText</code>]</span> ) : Ext.MessageBox <div class="mdesc"> |
---|
310 | <div class="short">Displays a message box with a progress bar. This message box has no buttons and is not closeable by |
---|
311 | the user. You a...</div> |
---|
312 | <div class="long"> |
---|
313 | Displays a message box with a progress bar. This message box has no buttons and is not closeable by |
---|
314 | the user. You are responsible for updating the progress bar as needed via <a ext:cls="Ext.MessageBox" ext:member="updateProgress" href="output/Ext.MessageBox.html#updateProgress">Ext.MessageBox.updateProgress</a> |
---|
315 | and closing the message box when the process is complete. <div class="mdetail-params"> |
---|
316 | <strong>Parameters:</strong> |
---|
317 | <ul><li><code>title</code> : String<div class="sub-desc">The title bar text</div></li><li><code>msg</code> : String<div class="sub-desc">The message box body text</div></li><li><code>progressText</code> : String<div class="sub-desc">(optional) The text to display inside the progress bar (defaults to '')</div></li> </ul> |
---|
318 | <strong>Returns:</strong> |
---|
319 | <ul> |
---|
320 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
321 | </ul> |
---|
322 | </div> |
---|
323 | </div> |
---|
324 | </div> |
---|
325 | </td> |
---|
326 | <td class="msource">MessageBox</td> |
---|
327 | </tr> |
---|
328 | <tr class="method-row expandable"> |
---|
329 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
330 | <td class="sig"> |
---|
331 | <a id="Ext.MessageBox-prompt"></a> |
---|
332 | <b>prompt</b>( <code>String title</code>, <code>String msg</code>, <span class="optional" title="Optional">[<code>Function fn</code>]</span>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Boolean/Number multiline</code>]</span>, <span class="optional" title="Optional">[<code>String value</code>]</span> ) : Ext.MessageBox <div class="mdesc"> |
---|
333 | <div class="short">Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's p...</div> |
---|
334 | <div class="long"> |
---|
335 | Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt). |
---|
336 | The prompt can be a single-line or multi-line textbox. If a callback function is passed it will be called after the user |
---|
337 | clicks either button, and the id of the button that was clicked (could also be the top-right |
---|
338 | close button) and the text that was entered will be passed as the two parameters to the callback. <div class="mdetail-params"> |
---|
339 | <strong>Parameters:</strong> |
---|
340 | <ul><li><code>title</code> : String<div class="sub-desc">The title bar text</div></li><li><code>msg</code> : String<div class="sub-desc">The message box body text</div></li><li><code>fn</code> : Function<div class="sub-desc">(optional) The callback function invoked after the message box is closed</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope of the callback function</div></li><li><code>multiline</code> : Boolean/Number<div class="sub-desc">(optional) True to create a multiline textbox using the defaultTextHeight |
---|
341 | property, or the height in pixels to create the textbox (defaults to false / single-line)</div></li><li><code>value</code> : String<div class="sub-desc">(optional) Default value of the text input element (defaults to '')</div></li> </ul> |
---|
342 | <strong>Returns:</strong> |
---|
343 | <ul> |
---|
344 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
345 | </ul> |
---|
346 | </div> |
---|
347 | </div> |
---|
348 | </div> |
---|
349 | </td> |
---|
350 | <td class="msource">MessageBox</td> |
---|
351 | </tr> |
---|
352 | <tr class="method-row alt expandable"> |
---|
353 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
354 | <td class="sig"> |
---|
355 | <a id="Ext.MessageBox-setIcon"></a> |
---|
356 | <b>setIcon</b>( <code>String icon</code> ) : Ext.MessageBox <div class="mdesc"> |
---|
357 | <div class="short">Adds the specified icon to the dialog. By default, the class 'ext-mb-icon' is applied for default |
---|
358 | styling, and the c...</div> |
---|
359 | <div class="long"> |
---|
360 | Adds the specified icon to the dialog. By default, the class 'ext-mb-icon' is applied for default |
---|
361 | styling, and the class passed in is expected to supply the background image url. Pass in empty string ('') |
---|
362 | to clear any existing icon. The following built-in icon classes are supported, but you can also pass |
---|
363 | in a custom class name: |
---|
364 | <pre>Ext.MessageBox.INFO |
---|
365 | Ext.MessageBox.WARNING |
---|
366 | Ext.MessageBox.QUESTION |
---|
367 | Ext.MessageBox.ERROR</pre> <div class="mdetail-params"> |
---|
368 | <strong>Parameters:</strong> |
---|
369 | <ul><li><code>icon</code> : String<div class="sub-desc">A CSS classname specifying the icon's background image url, or empty string to clear the icon</div></li> </ul> |
---|
370 | <strong>Returns:</strong> |
---|
371 | <ul> |
---|
372 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
373 | </ul> |
---|
374 | </div> |
---|
375 | </div> |
---|
376 | </div> |
---|
377 | </td> |
---|
378 | <td class="msource">MessageBox</td> |
---|
379 | </tr> |
---|
380 | <tr class="method-row expandable"> |
---|
381 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
382 | <td class="sig"> |
---|
383 | <a id="Ext.MessageBox-show"></a> |
---|
384 | <b>show</b>( <code>Object config</code> ) : Ext.MessageBox <div class="mdesc"> |
---|
385 | <div class="short">Displays a new message box, or reinitializes an existing message box, based on the config options |
---|
386 | passed in. All disp...</div> |
---|
387 | <div class="long"> |
---|
388 | Displays a new message box, or reinitializes an existing message box, based on the config options |
---|
389 | passed in. All display functions (e.g. prompt, alert, etc.) on MessageBox call this function internally, |
---|
390 | although those calls are basic shortcuts and do not support all of the config options allowed here. <div class="mdetail-params"> |
---|
391 | <strong>Parameters:</strong> |
---|
392 | <ul><li><code>config</code> : Object<div class="sub-desc">The following config options are supported: <ul> |
---|
393 | <li><b>animEl</b> : String/Element<div class="sub-desc">An id or Element from which the message box should animate as it |
---|
394 | opens and closes (defaults to undefined)</div></li> |
---|
395 | <li><b>buttons</b> : Object/Boolean<div class="sub-desc">A button config object (e.g., Ext.MessageBox.OKCANCEL or {ok:'Foo', |
---|
396 | cancel:'Bar'}), or false to not show any buttons (defaults to false)</div></li> |
---|
397 | <li><b>closable</b> : Boolean<div class="sub-desc">False to hide the top-right close button (defaults to true). Note that |
---|
398 | progress and wait dialogs will ignore this property and always hide the close button as they can only |
---|
399 | be closed programmatically.</div></li> |
---|
400 | <li><b>cls</b> : String<div class="sub-desc">A custom CSS class to apply to the message box's container element</div></li> |
---|
401 | <li><b>defaultTextHeight</b> : Number<div class="sub-desc">The default height in pixels of the message box's multiline textarea |
---|
402 | if displayed (defaults to 75)</div></li> |
---|
403 | <li><b>fn</b> : Function<div class="sub-desc">A callback function which is called when the dialog is dismissed either |
---|
404 | by clicking on the configured buttons, or on the dialog close button, or by pressing |
---|
405 | the return button to enter input. |
---|
406 | <p>Progress and wait dialogs will ignore this option since they do not respond to user |
---|
407 | actions and can only be closed programmatically, so any required function should be called |
---|
408 | by the same code after it closes the dialog. Parameters passed:<ul> |
---|
409 | <li><b>buttonId</b> : String<div class="sub-desc">The ID of the button pressed, one of:<div class="sub-desc"><ul> |
---|
410 | <li><tt>ok</tt></li> |
---|
411 | <li><tt>yes</tt></li> |
---|
412 | <li><tt>no</tt></li> |
---|
413 | <li><tt>cancel</tt></li> |
---|
414 | </ul></div></div></li> |
---|
415 | <li><b>text</b> : String<div class="sub-desc">Value of the input field if either <tt><a href="#show-option-prompt" ext:member="show-option-prompt" ext:cls="Ext.MessageBox">prompt</a></tt> |
---|
416 | or <tt><a href="#show-option-multiline" ext:member="show-option-multiline" ext:cls="Ext.MessageBox">multiline</a></tt> is true</div></li> |
---|
417 | <li><b>opt</b> : Object<div class="sub-desc">The config object passed to show.</div></li> |
---|
418 | </ul></p></div></li> |
---|
419 | <li><b>scope</b> : Object<div class="sub-desc">The scope of the callback function</div></li> |
---|
420 | <li><b>icon</b> : String<div class="sub-desc">A CSS class that provides a background image to be used as the body icon for the |
---|
421 | dialog (e.g. Ext.MessageBox.WARNING or 'custom-class') (defaults to '')</div></li> |
---|
422 | <li><b>iconCls</b> : String<div class="sub-desc">The standard <a ext:cls="Ext.Window" ext:member="iconCls" href="output/Ext.Window.html#iconCls">Ext.Window.iconCls</a> to |
---|
423 | add an optional header icon (defaults to '')</div></li> |
---|
424 | <li><b>maxWidth</b> : Number<div class="sub-desc">The maximum width in pixels of the message box (defaults to 600)</div></li> |
---|
425 | <li><b>minWidth</b> : Number<div class="sub-desc">The minimum width in pixels of the message box (defaults to 100)</div></li> |
---|
426 | <li><b>modal</b> : Boolean<div class="sub-desc">False to allow user interaction with the page while the message box is |
---|
427 | displayed (defaults to true)</div></li> |
---|
428 | <li><b>msg</b> : String<div class="sub-desc">A string that will replace the existing message box body text (defaults to the |
---|
429 | XHTML-compliant non-breaking space character '&#160;')</div></li> |
---|
430 | <li><a id="show-option-multiline"></a><b>multiline</b> : Boolean<div class="sub-desc"> |
---|
431 | True to prompt the user to enter multi-line text (defaults to false)</div></li> |
---|
432 | <li><b>progress</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li> |
---|
433 | <li><b>progressText</b> : String<div class="sub-desc">The text to display inside the progress bar if progress = true (defaults to '')</div></li> |
---|
434 | <li><a id="show-option-prompt"></a><b>prompt</b> : Boolean<div class="sub-desc">True to prompt the user to enter single-line text (defaults to false)</div></li> |
---|
435 | <li><b>proxyDrag</b> : Boolean<div class="sub-desc">True to display a lightweight proxy while dragging (defaults to false)</div></li> |
---|
436 | <li><b>title</b> : String<div class="sub-desc">The title text</div></li> |
---|
437 | <li><b>value</b> : String<div class="sub-desc">The string value to set into the active textbox element if displayed</div></li> |
---|
438 | <li><b>wait</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li> |
---|
439 | <li><b>waitConfig</b> : Object<div class="sub-desc">A <a ext:cls="Ext.ProgressBar" ext:member="waitConfig" href="output/Ext.ProgressBar.html#waitConfig">Ext.ProgressBar.waitConfig</a> object (applies only if wait = true)</div></li> |
---|
440 | <li><b>width</b> : Number<div class="sub-desc">The width of the dialog in pixels</div></li> |
---|
441 | </ul> |
---|
442 | Example usage: |
---|
443 | <pre><code>Ext.Msg.show({ |
---|
444 | title: <em>'Address'</em>, |
---|
445 | msg: <em>'Please enter your address:'</em>, |
---|
446 | width: 300, |
---|
447 | buttons: Ext.MessageBox.OKCANCEL, |
---|
448 | multiline: true, |
---|
449 | fn: saveAddress, |
---|
450 | animEl: <em>'addAddressBtn'</em>, |
---|
451 | icon: Ext.MessageBox.INFO |
---|
452 | });</code></pre></div></li> </ul> |
---|
453 | <strong>Returns:</strong> |
---|
454 | <ul> |
---|
455 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
456 | </ul> |
---|
457 | </div> |
---|
458 | </div> |
---|
459 | </div> |
---|
460 | </td> |
---|
461 | <td class="msource">MessageBox</td> |
---|
462 | </tr> |
---|
463 | <tr class="method-row alt expandable"> |
---|
464 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
465 | <td class="sig"> |
---|
466 | <a id="Ext.MessageBox-updateProgress"></a> |
---|
467 | <b>updateProgress</b>( <code>Number value</code>, <code>String progressText</code>, <code>String msg</code> ) : Ext.MessageBox <div class="mdesc"> |
---|
468 | <div class="short">Updates a progress-style message box's text and progress bar. Only relevant on message boxes |
---|
469 | initiated via Ext.Messag...</div> |
---|
470 | <div class="long"> |
---|
471 | Updates a progress-style message box's text and progress bar. Only relevant on message boxes |
---|
472 | initiated via <a ext:cls="Ext.MessageBox" ext:member="progress" href="output/Ext.MessageBox.html#progress">Ext.MessageBox.progress</a> or <a ext:cls="Ext.MessageBox" ext:member="wait" href="output/Ext.MessageBox.html#wait">Ext.MessageBox.wait</a>, |
---|
473 | or by calling <a ext:cls="Ext.MessageBox" ext:member="show" href="output/Ext.MessageBox.html#show">Ext.MessageBox.show</a> with progress: true. <div class="mdetail-params"> |
---|
474 | <strong>Parameters:</strong> |
---|
475 | <ul><li><code>value</code> : Number<div class="sub-desc">Any number between 0 and 1 (e.g., .5, defaults to 0)</div></li><li><code>progressText</code> : String<div class="sub-desc">The progress text to display inside the progress bar (defaults to '')</div></li><li><code>msg</code> : String<div class="sub-desc">The message box's body text is replaced with the specified string (defaults to undefined |
---|
476 | so that any existing body text will not get overwritten by default unless a new value is passed in)</div></li> </ul> |
---|
477 | <strong>Returns:</strong> |
---|
478 | <ul> |
---|
479 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
480 | </ul> |
---|
481 | </div> |
---|
482 | </div> |
---|
483 | </div> |
---|
484 | </td> |
---|
485 | <td class="msource">MessageBox</td> |
---|
486 | </tr> |
---|
487 | <tr class="method-row expandable"> |
---|
488 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
489 | <td class="sig"> |
---|
490 | <a id="Ext.MessageBox-updateText"></a> |
---|
491 | <b>updateText</b>( <span class="optional" title="Optional">[<code>String text</code>]</span> ) : Ext.MessageBox <div class="mdesc"> |
---|
492 | <div class="short">Updates the message box body text</div> |
---|
493 | <div class="long"> |
---|
494 | Updates the message box body text <div class="mdetail-params"> |
---|
495 | <strong>Parameters:</strong> |
---|
496 | <ul><li><code>text</code> : String<div class="sub-desc">(optional) Replaces the message box element's innerHTML with the specified string (defaults to |
---|
497 | the XHTML-compliant non-breaking space character '&#160;')</div></li> </ul> |
---|
498 | <strong>Returns:</strong> |
---|
499 | <ul> |
---|
500 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
501 | </ul> |
---|
502 | </div> |
---|
503 | </div> |
---|
504 | </div> |
---|
505 | </td> |
---|
506 | <td class="msource">MessageBox</td> |
---|
507 | </tr> |
---|
508 | <tr class="method-row alt expandable"> |
---|
509 | <td class="micon"><a class="exi" href="#expand"> </a></td> |
---|
510 | <td class="sig"> |
---|
511 | <a id="Ext.MessageBox-wait"></a> |
---|
512 | <b>wait</b>( <code>String msg</code>, <span class="optional" title="Optional">[<code>String title</code>]</span>, <span class="optional" title="Optional">[<code>Object config</code>]</span> ) : Ext.MessageBox <div class="mdesc"> |
---|
513 | <div class="short">Displays a message box with an infinitely auto-updating progress bar. This can be used to block user |
---|
514 | interaction whi...</div> |
---|
515 | <div class="long"> |
---|
516 | Displays a message box with an infinitely auto-updating progress bar. This can be used to block user |
---|
517 | interaction while waiting for a long-running process to complete that does not have defined intervals. |
---|
518 | You are responsible for closing the message box when the process is complete. <div class="mdetail-params"> |
---|
519 | <strong>Parameters:</strong> |
---|
520 | <ul><li><code>msg</code> : String<div class="sub-desc">The message box body text</div></li><li><code>title</code> : String<div class="sub-desc">(optional) The title bar text</div></li><li><code>config</code> : Object<div class="sub-desc">(optional) A <a ext:cls="Ext.ProgressBar" ext:member="waitConfig" href="output/Ext.ProgressBar.html#waitConfig">Ext.ProgressBar.waitConfig</a> object</div></li> </ul> |
---|
521 | <strong>Returns:</strong> |
---|
522 | <ul> |
---|
523 | <li><code>Ext.MessageBox</code><div class="sub-desc">this</div></li> |
---|
524 | </ul> |
---|
525 | </div> |
---|
526 | </div> |
---|
527 | </div> |
---|
528 | </td> |
---|
529 | <td class="msource">MessageBox</td> |
---|
530 | </tr> |
---|
531 | </table> |
---|
532 | <a id="Ext.MessageBox-events"></a> |
---|
533 | <h2>Public Events</h2> |
---|
534 | <div class="no-members">This class has no public events.</div> |
---|
535 | </div> |
---|