ExtJs 4.x - MessagerBox
1.alert(提示框)
1.基本提示框(alert)
简单事例:
Ext.Msg.alert('提示', 'ExtJs Alert 方法弹出效果');
alert( String title, String msg, Function fn, Object scope ) : Ext.MessageBox
显示一个标准的带有确认按钮的只读消息框(类似于 JavaScript原...
显示一个标准的带有确认按钮的只读消息框(类似于 JavaScript原生的 alert函数、prompt函数)。如果给定了回调函数,则会在用户点击按钮后执行,并且被点击的按钮的 ID 会当做唯一的参数传入到回调函数中(也有可能是右上角的关闭按钮)。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).
参数项:
|
2.promot(带文本的提示框)
简单事例:
Ext.Msg.prompt('姓名', '请输入你的姓名:', function(btn, text){
if (btn == 'ok'){
Ext.Msg.alert(text);
}else{
Ext.Msg.alert("请刷新页面重新输入");
}
});
API:
prompt( String title, String msg, Function fn, Object scope, Boolean/Number multiline, String value ) : Ext.MessageBox
显示一个带有确认和取消按钮的提示框,并接受用户输入文本(等同与Java...
显示一个带有确认和取消按钮的提示框,并接受用户输入文本(等同与JavaScript原生的prompt函数)。提示框可以是一个单行或多行文本框。如果给定了回调函数,则在用户点击任意一个按钮后执行回调函数, 并且被点击的按钮的ID(有可能是右上角的关闭按钮)和用户输入的文本都将被当做参数传给回调函数。Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt). The prompt can be a single-line or multi-line textbox. 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 (could also be the top-right close button) and the text that was entered will be passed as the two parameters to the callback.
参数项:
|
3.show窗口
简单事例:
Ext.MessageBox.show({
title:'保存更改?',
msg: '你即将关闭这个窗口,是否确认?',
buttons: Ext.Msg.YESNOCANCEL,
icon: Ext.MessageBox.QUESTION
});
API:
show( Object config ) : Ext.MessageBox
基于给定的配置选项显示一个消息框,或者重新初始一个现存的消息框。Mes...
基于给定的配置选项显示一个消息框,或者重新初始一个现存的消息框。MessageBox 对象的所有显示函数(例如:prompt、alert、等等)均为内部调用此函数, 虽然这些调用均为此方法的简单的快捷方式并且不提供所有的下列配置选项。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.
参数项:
|
4.confirm确认框
简单事例:
Ext.MessageBox.confirm("确定XX吗?" ,"确定要XXX!");
API:
confirm( String title, String msg, Function fn, Object scope ) : Ext.MessageBox
显示一个带有是和否按钮的确认消息框(等同与JavaScript 原生的...
显示一个带有是和否按钮的确认消息框(等同与JavaScript 原生的confirm函数)。如果给定了回调函数,则会在用户点击按钮后执行,并且被点击的按钮的ID会当做唯一的参数传入到回调函数中(也有可能是右上角的关闭按钮)。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).
参数项:
|
5.progress进度条
简单事例:
Ext.MessageBox.progress({
title:"进度条",
msg:"当前页面正在读取进度",
progress:true,
wait:true,
progressText:"读取中。。。",
waitConfig:{
interval:500,
duration:5000,
fn:function(){
Ext.MessageBox.hide();
}
}
});
API:
同show的API
转载请注明来源

浙公网安备 33010602011771号