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