Ext.require([
'Ext.window.MessageBox',
'Ext.tip.*'
]); Ext.onReady(function(){
                         Ext.MessageBox.confirm('确认', '你确定要删除' + empname + '共' + records.length + '条记录吗?', function (e) {
if (e == "yes") {
PersonManage.EmployeeManager.delEmp(empId);
}
});
    Ext.get('mb2').on('click', function(e){
Ext.MessageBox.prompt('Name', 'Please enter your name:', showResultText);
}); Ext.get('mb3').on('click', function(e){
Ext.MessageBox.show({
title: 'Address',
msg: 'Please enter your address:',
width:300,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: showResultText,
animateTarget: 'mb3'
});
}); Ext.get('mb4').on('click', function(e){
Ext.MessageBox.show({
title:'Save Changes?',
msg: 'You are closing a tab that has unsaved changes. <br />Would you like to save your changes?',
buttons: Ext.MessageBox.YESNOCANCEL,
fn: showResult,
animateTarget: 'mb4',
icon: Ext.MessageBox.QUESTION
});
}); Ext.get('mb6').on('click', function(){
Ext.MessageBox.show({
title: 'Please wait',
msg: 'Loading items...',
progressText: 'Initializing...',
width:300,
progress:true,
closable:false,
animateTarget: 'mb6'
}); // this hideous block creates the bogus progress
var f = function(v){
return function(){
if(v == 12){
Ext.MessageBox.hide();
Ext.example.msg('Done', 'Your fake items were loaded!');
}else{
var i = v/11;
Ext.MessageBox.updateProgress(i, Math.round(100*i)+'% completed');
}
};
};
for(var i = 1; i < 13; i++){
setTimeout(f(i), i*500);
}
}); Ext.get('mb7').on('click', function(){
Ext.MessageBox.show({
msg: 'Saving your data, please wait...',
progressText: 'Saving...',
width:300,
wait:true,
waitConfig: {interval:200},
icon:'ext-mb-download', //custom class in msg-box.html
iconHeight: 50,
animateTarget: 'mb7'
});
setTimeout(function(){
//This simulates a long-running operation like a database save or XHR call.
//In real code, this would be in a callback function.
Ext.MessageBox.hide();
Ext.example.msg('Done', 'Your fake data was saved!');
}, 8000);
}); Ext.get('mb8').on('click', function(){
Ext.MessageBox.alert('Status', 'Changes saved successfully.', showResult);
}); //Add these values dynamically so they aren't hard-coded in the html
Ext.fly('info').dom.value = Ext.MessageBox.INFO;
Ext.fly('question').dom.value = Ext.MessageBox.QUESTION;
Ext.fly('warning').dom.value = Ext.MessageBox.WARNING;
Ext.fly('error').dom.value = Ext.MessageBox.ERROR; Ext.get('mb9').on('click', function(){
Ext.MessageBox.show({
title: 'Icon Support',
msg: 'Here is a message with an icon!',
buttons: Ext.MessageBox.OK,
animateTarget: 'mb9',
fn: showResult,
icon: Ext.get('icons').dom.value
});
}); Ext.get('mb10').on('click', function(){
Ext.MessageBox.show({
title: 'What, really?',
msg: 'Are you sure?',
buttons: Ext.MessageBox.YESNO,
buttonText:{
yes: "Definitely!",
no: "No chance!"
},
fn: showResult
});
}); function showResult(btn){
Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
} function showResultText(btn, text){
Ext.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);
}
});

Ext.MessageBox的更多相关文章

  1. Ext.MessageBox消息框

    Ext JS消息提示框主要包括:alert.confirm.prompt.show 1.Ext.MessageBox.alert() 调用格式: alert( String title, String ...

  2. [转载]ExtJs4 笔记(6) Ext.MessageBox 消息对话框

    作者:李盼(Lipan) 出处:[Lipan] (http://www.cnblogs.com/lipan/)版权声明:本文的版权归作者与博客园共有.转载时须注明本文的详细链接,否则作者将保留追究其法 ...

  3. ExtJS4之Ext.MessageBox的各种用法

    1. Ext.Msg.alert(String title,String msg)[Ext.MsssageBox.alert(Sting title,Sting msg,fn)]与javascript ...

  4. Ext.MessageBox的用法

    1.Ext.MessageBox.alert()方法 有四个参数:alert( title , msg , function(){} ,this) 其中title,msg为必选参数,function为 ...

  5. ExtJs4 笔记(6) Ext.MessageBox 消息对话框

    本篇演示消息对话框的用法,ExtJs封装了可能用到的各类消息框,并支持自定义的配置. 如下是用到的html: [html] <h1>各种消息框</h1> <div id= ...

  6. 【编程技巧】Ext.MessageBox 大集合 不同的dialog图解加写法

    1.alert对话框 效果图: function a1(){ Ext.MessageBox.alert('title','text');  } 2.confirm案例,确定不确定2个按钮对话框 效果图 ...

  7. 实用ExtJS教程100例-005:自定义对话框Ext.MessageBox.show

    我们对ExtJS对话框进行了三篇演示: MessageBox的三种用法 进度条对话框Ext.MessageBox.progress 等待对话框Ext.MessageBox.wait 通过上面三篇内容的 ...

  8. 实用ExtJS教程100例-004:等待对话框Ext.MessageBox.wait

    在前面两节中,我们分别演示了ExtJS三种常用的对话框和ExtJS带有进度条的对话框.在本节内容中,我们来看看ExtJS中的等待对话框. 首先来看一个简单的例子[查看在线示例]: 这种对话框会一直滚动 ...

  9. 实用ExtJS教程100例-003:进度条对话框Ext.MessageBox.progress

    在上一篇内容中我们介绍了三种常用的MessageBox提示框,在这篇文章中,我们将演示如何在对话框中使用进度条. 进度条对话框 我们可以使用下面的代码来在MessageBox中显示一个进度条: Ext ...

随机推荐

  1. OpenJudge计算概论-比饭量【枚举法、信息数字化】

    /*====================================================================== 比饭量 总时间限制: 1000ms 内存限制: 655 ...

  2. 使用定时器实现JavaScript的延期执行或重复执行

    使用定时器实现JavaScript的延期执行或重复执行 window 对象提供了两个方法来实现定时器的效果,分别是window.setTimeout()和 window.setInterval.其中前 ...

  3. MySQL Show命令的使用

    show tables或show tables from database_name; 解释:显示当前数据库中所有表的名称 show databases; 解释:显示mysql中所有数据库的名称 sh ...

  4. es6新特性

    变量-------------------------- let, const:必须直接给一个变量赋值.注意,对象的属性或数组成员还是可以改变的. const MY_OBJECT = {some: 1 ...

  5. DataList与Repeater嵌套绑定

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs&quo ...

  6. mysqlbinlog快速遍历搜索记录 (转)

    目标,开发人员说有个数据莫名其妙添加了,但是不知道是从哪里添加的,而且应用功能里面不应该添加这样的数据,为了查清楚来源,所 以我就准备去binlog里面找了,但是binlog有好几个月的数,我这样一个 ...

  7. 使用Node.js和Redis实现push服务--转载

    出处:http://blog.csdn.net/unityoxb/article/details/8532028 push服务是一项很有用处的技术,它能改善交互,提升用户体验.要实现这项服务通常有两种 ...

  8. Hive(一):架构及知识体系

    Hive是一个基于Hadoop的数据仓库,最初由Facebook提供,使用HQL作为查询接口.HDFS作为存储底层.mapReduce作为执行层,设计目的是让SQL技能良好,但Java技能较弱的分析师 ...

  9. nova分析(3)—— nova-api

    nova-api是nova对外提供Restful API的服务,Horizon.novaclient等均通过该api与nova进行通信. nova其实对外提供了多个api服务,包括下面这些服务: no ...

  10. 51nod 1411 矩阵取数问题 V3

    给定一个m行n列的矩阵,你可以从任意位置开始取数,到达任意位置都可以结束,每次可以走到的数是当前这个数上下左右的邻居之一,唯一的限制是每个位置只能经过一次,也就是说你的路径不自交.所经过的数的总作为你 ...