标签:关闭 oca mat 回调函数 confirm format 1.5 用户 font
1、Ext.Msg.alert(String title, String msg, [Function fn], [Object scope])
显示一个标准的带有一个“确定”按钮的只读消息框(类似于基本的JavaScript警告提示)。
参数:
eg:
1 Ext.Msg.alert("提示", "没有可归档的文件"); 2 Ext.Msg.alert("提示", "没有可归档的文件", function () { 3 alert("提示框关闭"); 4 });
2、Ext.Msg.prompt( String title, String msg, [Function fn], [Object scope], [Boolean/Number multiline], [String value] )
显示一个带有“确定”和“取消”按钮,提供用户输入一些文本的消息框(类似于JavaScript的提示),可以是一个单行或者多行的文本框。
参数:
eg:
1 Ext.Msg.prompt(‘Name‘, ‘Please enter your name:‘, function (btn, text) { 2 if (btn == ‘ok‘) { 3 Ext.Msg.alert("Result", "button: " + btn + "<br> input: " + text); 4 } 5 }, this, 150, ‘wuln‘);
3、Ext.Msg.confirm( String title, String msg, [Function fn], [Object scope] )
显示一个带有“YES”和“NO”按钮的确认消息框(类似于JavaScript的确认)。
参数:
eg:
1 Ext.Msg.confirm("是否保存", String.format(‘编辑文件后选“是”则提交修改,选“否”则放弃修改<br/><br/>‘), function (e) { 2 if (e == "yes") { 3 Ext.Msg.alert("提示", "文件保存成功!"); 4 } 5 }, this);
4、Ext.Msg.show( Object config )
显示一个新的消息框,或者基于配置项重新初始化一个已存在的消息框。
常用配置项:
Ext.Msg.OK
Ext.Msg.YES
Ext.Msg.NO
Ext.Msg.CANCEL
Ext.MessageBox.INFO
Ext.MessageBox.WARNING
Ext.MessageBox.QUESTION
Ext.MessageBox.ERROR
eg:
1 Ext.Msg.show({ 2 title: ‘Save Changes?‘, 3 msg: ‘You are closing a tab that has unsaved changes. Would you like to save your changes?‘, 4 buttons: Ext.Msg.YESNOCANCEL, 5 icon: Ext.MessageBox.QUESTION 6 });
1 Ext.Msg.show({ 2 title: "提示", 3 msg: "请输入:", 4 width: 400, 5 multiline: true, 6 closable: false, 7 buttons: Ext.MessageBox.OK, 8 icon: Ext.MessageBox.INFO, 9 fn: function (btn, text) { 10 Ext.Msg.alert("Result", String.format("btn : OK<br> input: " + text)); 11 } 12 });
1 Ext.Msg.show({ 2 title: ‘请稍后‘, 3 msg: ‘正在导出...‘, 4 progressText: ‘正在初始化...‘, 5 width: 400, 6 progress: true, 7 closable: false 8 }); 9 var progress = function (w) { 10 return function () { 11 if (w == 12) { 12 Ext.Msg.hide(); 13 Ext.Msg.alert(‘完成‘, ‘导出成功!‘); 14 } else { 15 var e = w / 11; 16 Ext.Msg.updateProgress(e, Math.round(100 * e) + ‘%‘); 17 } 18 }; 19 }; 20 for (var i = 0; i < 13; i++) { 21 setTimeout(progress(i), i * 500); 22 }
标签:关闭 oca mat 回调函数 confirm format 1.5 用户 font
原文地址:http://www.cnblogs.com/wuln/p/6229207.html