パッケージ: | Ext |
定義ファイル: | MessageBox.js |
クラス: | Ext.MessageBox |
継承元: | Object |
// Basic alert:
Ext.Msg.alert('Status', 'Changes saved successfully.');
// Prompt for user data and process the result using a callback:
Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
if (btn == 'ok'){
// process text value and close...
}
});
// Show a dialog using config options:
Ext.Msg.show({
title:'Save Changes?',
msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
buttons: Ext.Msg.YESNOCANCEL,
fn: processResult,
animEl: 'elId',
icon: Ext.MessageBox.QUESTION
});
Utility class for generating different styles of message boxes. The alias Ext.Msg can also be used.
Note that the MessageBox is asynchronous. Unlike a regular JavaScript alert
(which will halt browser execution), showing a MessageBox will not cause the code to stop. For this reason, if you have code that should only run after some user feedback from the MessageBox, you must use a callback function (see the function
parameter for show for more details).
// Basic alert:
Ext.Msg.alert('Status', 'Changes saved successfully.');
// Prompt for user data and process the result using a callback:
Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
if (btn == 'ok'){
// process text value and close...
}
});
// Show a dialog using config options:
Ext.Msg.show({
title:'Save Changes?',
msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
buttons: Ext.Msg.YESNOCANCEL,
fn: processResult,
animEl: 'elId',
icon: Ext.MessageBox.QUESTION
});
プロパティ | 定義クラス | |
---|---|---|
CANCEL
:
Object キャンセルボタン定数 Button config that displays a single Cancel button | Ext.MessageBox | |
ERROR
:
String エラーアイコン定数 The CSS class that provides the ERROR icon image | Ext.MessageBox | |
INFO
:
String 情報アイコン定数 The CSS class that provides the INFO icon image | Ext.MessageBox | |
Msg
:
Object Ext.MessageBoxへのエイリアス Shorthand for Ext.MessageBox | Ext.MessageBox | |
OK
:
Object OKボタン定数 Button config that displays a single OK button | Ext.MessageBox | |
OKCANCEL
:
Object OKボタンとキャンセルボタン定数 Button config that displays OK and Cancel buttons | Ext.MessageBox | |
QUESTION
:
String クエッションアイコン定数 The CSS class that provides the QUESTION icon image | Ext.MessageBox | |
WARNING
:
String 警告アイコン定数 The CSS class that provides the WARNING icon image | Ext.MessageBox | |
YESNO
:
Object はいボタン、いいえボタン定数 Button config that displays Yes and No buttons | Ext.MessageBox | |
YESNOCANCEL
:
Object はいボタン、いいえボタン、キャンセルボタン定数 Button config that displays Yes, No and Cancel buttons | Ext.MessageBox | |
buttonText
:
Object
ボタンに表示するテキスト。
ok, cancel, yes, noに関してはデフォルトで指定されますが、このプロパテ... An object containing the default button text strings that can be overriden for localized language...
ボタンに表示するテキスト。 ok, cancel, yes, noに関してはデフォルトで指定されますが、このプロパティで上書きすることで変更できます。 そもそものデフォルトテキストを変更したい場合は、Ext.MessageBox.buttonText.yes = "oui"のような形で変更することができます。 An object containing the default button text strings that can be overriden for localized language support. Supported properties are: ok, cancel, yes and no. Generally you should include a locale-specific resource file for handling language support across the framework. Customize the default text like so: Ext.MessageBox.buttonText.yes = "oui"; //french | Ext.MessageBox | |
defaultTextHeight
:
Number 複数行のテキストエリアを使用する際の、デフォルト高さを設定します。(初期値:75) The default height in pixels of the message box's multiline textarea if displayed (defaults to 75) | Ext.MessageBox | |
maxWidth
:
Number メッセージボックスの最大幅(初期値:600) The maximum width in pixels of the message box (defaults to 600) | Ext.MessageBox | |
minProgressWidth
:
Number プログレススタイルのメッセージボックスの最小幅を設定します。(初期値:250) The minimum width in pixels of the message box if it is a progress-style dialog. This is useful
for setting a different minimum width than text-only dialogs may need (defaults to 250) | Ext.MessageBox | |
minWidth
:
Number メッセージボックスの最小幅(初期値:110) The minimum width in pixels of the message box (defaults to 110) | Ext.MessageBox |
メソッド | 定義クラス | |
---|---|---|
alert(
String title, String msg, [Function fn], [Object scope]
)
:
Ext.MessageBox
一般的なOKボタンを持つ、アラートメッセージを表示します。
コールバック関数を設定すれば、ユーザー... Displays a standard read-only message box with an OK button (comparable to the basic JavaScript a...
一般的なOKボタンを持つ、アラートメッセージを表示します。 コールバック関数を設定すれば、ユーザーがボタンを押した後に任意の処理を行うことができます。 また、右上の×ボタンでも動作します。 Displays a standard read-only message box with an OK button (comparable to the basic JavaScript alert prompt). If a callback function is passed it will be called after the user clicks the button, and the id of the button that was clicked will be passed as the only parameter to the callback (could also be the top-right close button). パラメータ:
| Ext.MessageBox | |
confirm(
String title, String msg, [Function fn], [Object scope]
)
:
Ext.MessageBox
「はい」「いいえ」ボタンを持つメッセージボックスを表示します。
コールバック関数を設定すれば、ユ... Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm)....
「はい」「いいえ」ボタンを持つメッセージボックスを表示します。 コールバック関数を設定すれば、ユーザーがボタンを押した後に任意の処理を行うことができます。 また、右上の×ボタンでも動作します。 Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm). If a callback function is passed it will be called after the user clicks either button, and the id of the button that was clicked will be passed as the only parameter to the callback (could also be the top-right close button). パラメータ:
| Ext.MessageBox | |
getDialog()
:
Ext.Window
内部で使用されているExt.Windowオブジェクトを取得します。
Returns a reference to the underlying Ext.Window element
内部で使用されているExt.Windowオブジェクトを取得します。
Returns a reference to the underlying Ext.Window element
戻り値:
| Ext.MessageBox | |
hide()
:
Ext.MessageBox メッセージボックスを非表示にします。 Hides the message box if it is displayed メッセージボックスを非表示にします。 Hides the message box if it is displayed 戻り値:
| Ext.MessageBox | |
isVisible()
:
Boolean メッセージボックスの表示状態を取得します。 Returns true if the message box is currently displayed メッセージボックスの表示状態を取得します。 Returns true if the message box is currently displayed 戻り値:
| Ext.MessageBox | |
progress(
String title, String msg, [String progressText]
)
:
Ext.MessageBox
プログレスバーを持つ、メッセージボックスを表示します。
このメッセージボックスは、ボタンもなくユ... Displays a message box with a progress bar.
This message box has no buttons and is not closeable ...
プログレスバーを持つ、メッセージボックスを表示します。 このメッセージボックスは、ボタンもなくユーザー操作によるクローズはできません。 Ext.MessageBox.updateProgress を参照して、処理が完了したときにメッセージボックスをクローズする必要があります。 Displays a message box with a progress bar. This message box has no buttons and is not closeable by the user. You are responsible for updating the progress bar as needed via Ext.MessageBox.updateProgress and closing the message box when the process is complete. パラメータ:
| Ext.MessageBox | |
prompt(
String title, String msg, [Function fn], [Object scope], [Boolean/Number multiline], [String value]
)
:
Ext.MessageBoxパラメータ:
| Ext.MessageBox | |
setIcon(
String icon
)
:
Ext.MessageBox
ダイアログに表示するアイコンを設定します。
(初期値:'ext-mb-icon')
''を設定するとアイコンを表示し... Adds the specified icon to the dialog. By default, the class 'ext-mb-icon' is applied for defaul...
ダイアログに表示するアイコンを設定します。
(初期値:'ext-mb-icon') ''を設定するとアイコンを表示しません。 ビルトインで用意されているアイコンは、次の通りです。 Ext.MessageBox.INFO Ext.MessageBox.WARNING Ext.MessageBox.QUESTION Ext.MessageBox.ERROR Adds the specified icon to the dialog. By default, the class 'ext-mb-icon' is applied for default styling, and the class passed in is expected to supply the background image url. Pass in empty string ('') to clear any existing icon. This method must be called before the MessageBox is shown. The following built-in icon classes are supported, but you can also pass in a custom class name:
Ext.MessageBox.INFO Ext.MessageBox.WARNING Ext.MessageBox.QUESTION Ext.MessageBox.ERROR パラメータ:
| Ext.MessageBox | |
show(
Object config
)
:
Ext.MessageBox
メッセージボックスを表示します。
または、既存のメッセージボックスを再設定して表示します。
アラー... Displays a new message box, or reinitializes an existing message box, based on the config options...
メッセージボックスを表示します。
または、既存のメッセージボックスを再設定して表示します。 アラートやプロンプトも、内部でこのメソッドを呼び出しています。 Displays a new message box, or reinitializes an existing message box, based on the config options passed in. All display functions (e.g. prompt, alert, etc.) on MessageBox call this function internally, although those calls are basic shortcuts and do not support all of the config options allowed here. パラメータ:
| Ext.MessageBox | |
updateProgress(
Number value, String progressText, String msg
)
:
Ext.MessageBox
プログレスバーの状態を更新します。
Ext.MessageBox.show
を呼び出した時にprogressがtrueの場合、初... Updates a progress-style message box's text and progress bar.
Only relevant on message boxes ini...
プログレスバーの状態を更新します。 Ext.MessageBox.show を呼び出した時にprogressがtrueの場合、初期状態では、Ext.MessageBox.progress か Ext.MessageBox.waitで設定された状態になります。 Updates a progress-style message box's text and progress bar. Only relevant on message boxes initiated via Ext.MessageBox.progress or Ext.MessageBox.wait, or by calling Ext.MessageBox.show with progress: true. パラメータ:
| Ext.MessageBox | |
updateText(
[String text]
)
:
Ext.MessageBoxメッセージボックスのメッセージを更新します。 Updates the message box body text メッセージボックスのメッセージを更新します。 Updates the message box body text パラメータ:
| Ext.MessageBox | |
wait(
String msg, [String title], [Object config]
)
:
Ext.MessageBox
待機用プログレスバーを持つメッセージボックスを表示します。
Displays a message box with an infinitely auto-updating progress bar. This can be used to block u...
待機用プログレスバーを持つメッセージボックスを表示します。
Displays a message box with an infinitely auto-updating progress bar. This can be used to block user interaction while waiting for a long-running process to complete that does not have defined intervals. You are responsible for closing the message box when the process is complete. パラメータ:
| Ext.MessageBox |