用来生成不同样式的消息框的实用类。还可以使用它的别名Ext.Msg。Utility class for generating different styles of message boxes. The alias Ext.Msg can also be used.
需要注意的是 MessageBox 对象是异步的。不同于 JavaScript中原生的alert(它会暂停浏览器的执行),显示 MessageBox 不会中断代码的运行。由于这个原因,如果你的代码需要在用户对 MessageBox 做出反馈之后执行,则必须用到回调函数(详情可见show方法中的function参数)。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).
用法示例:Example usage:
// 基本的通知: 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
});
分享到:
相关推荐
Ext.MessageBox.confirm()详解 显示一个确认对话框,用来代替JavaScript标准的confirm()方法,具有两个按钮“是”和“否”如果为其提供一个回调函数,则该函数将在单击按钮后被调用(包括右上角的...
代码如下: Ext.onReady(function() { Ext.Msg.alert(‘提示’, ‘逗号分隔参数列表’); //这种方式非常常见的 ...接下来认识一下Ext.MessageBox Ext.MessageBox是一个工具类,他继承自Obiect对象,用来生成各种
案例如下: 代码如下: Ext.onReady(function(){ Ext.MessageBox.alert(“提示”,”请单击我,确定”,callBack); function callBack(id){ alert(“单击的按钮ID是:”+id); } Ext.MessageBox....
ext中的各种消息框,提示框,输入框,确认框,自定义消息框,进度条,以及滑动提示。
博文链接:https://vincent-yy.iteye.com/blog/233744
NULL 博文链接:https://ch-dj.iteye.com/blog/1946952
3.2.3 Ext.MessageBox.confirm() 3.2.4 Ext.MessageBox.prompt() 3.2.5 Ext.MessageBox.wait() 3.2.6 Ext.MessageBox.show() 3.2.7 Ext.window.MessageBox的其他功能 3.3 进度条组件介绍 3.3.1 认识...
Ext.MessageBox.confirm('确认提示', '你确定要导出Excel吗?', function deldbconfig(btn) { if (btn == 'yes') { var msgTip = Ext.MessageBox.show({ title : '提示', width : 350, msg :...
改变Messagebox按钮的文字[改变Messagebox按钮的文字]-精品源代码
5.2.3 Ext.MessageBox.confirm() 5.2.4 Ext.MessageBox.prompt() 5.2.5 Ext.MessageBox.wait() 5.2.6 Ext.MessageBox.show() 5.2.7 Ext.MessageBox的其他功能 5.3 进度条组件 5.3.1 Ext.ProgressBar简介 ...
Ext.MessageBox.show({ title:"这是标题", msg:"这是提示内容,很精彩!!", width:500, icon:Ext.MessageBox.WARNING, //wait:true, prompt:true, buttons:{ "ok": "我显示", "cancel": "手表", "yes":...
4.4.5 管理类的类:ext.classmanager / 159 4.4.6 类创建的总结 / 161 4.5 动态加载的路径设置 / 163 4.6 综合实例:页面计算器 / 165 4.7 本章小结 / 169 第5章 ext js的事件及其应用 / 170 5.1 概述 / 170 ...
5.2.3 Ext.MessageBox.confirm() 5.2.4 Ext.MessageBox.prompt() 5.2.5 Ext.MessageBox.wait() 5.2.6 Ext.MessageBox.show() 5.2.7 Ext.MessageBox的其他功能 5.3 进度条组件 5.3.1 Ext.ProgressBar简介 ...
1. ExtJs2.0学习系列(1)--Ext.MessageBox 2. ExtJs2.0学习系列(2)--Ext.Panel 3. ExtJs2.0学习系列(3)--Ext.Window 4. ExtJs2.0学习系列(4)--Ext.FormPanel之第一式 5. ExtJs2.0学习系列(5)--Ext.FormPanel之第二式 ...
论坛上找的ExtJs消息提示框,各个方向的都有,十分人性化
第六章 Ext.MessageBox 消息对话框 46 一、警告对话框和确认对话框 46 二、输入对话框 47 三、自定义DIY对话框 48 四、加载进度条对话框 49 五、等待进度条对话框 50 六、基本的等待对话框 51 第七章 Ext.tip....
修改过的Ext.MessageBox.prompt方法,可直接调用,对输入的文字加密,适合做密码验证框