Ext.MessageBox
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的更多相关文章
- Ext.MessageBox消息框
Ext JS消息提示框主要包括:alert.confirm.prompt.show 1.Ext.MessageBox.alert() 调用格式: alert( String title, String ...
- [转载]ExtJs4 笔记(6) Ext.MessageBox 消息对话框
作者:李盼(Lipan) 出处:[Lipan] (http://www.cnblogs.com/lipan/)版权声明:本文的版权归作者与博客园共有.转载时须注明本文的详细链接,否则作者将保留追究其法 ...
- ExtJS4之Ext.MessageBox的各种用法
1. Ext.Msg.alert(String title,String msg)[Ext.MsssageBox.alert(Sting title,Sting msg,fn)]与javascript ...
- Ext.MessageBox的用法
1.Ext.MessageBox.alert()方法 有四个参数:alert( title , msg , function(){} ,this) 其中title,msg为必选参数,function为 ...
- ExtJs4 笔记(6) Ext.MessageBox 消息对话框
本篇演示消息对话框的用法,ExtJs封装了可能用到的各类消息框,并支持自定义的配置. 如下是用到的html: [html] <h1>各种消息框</h1> <div id= ...
- 【编程技巧】Ext.MessageBox 大集合 不同的dialog图解加写法
1.alert对话框 效果图: function a1(){ Ext.MessageBox.alert('title','text'); } 2.confirm案例,确定不确定2个按钮对话框 效果图 ...
- 实用ExtJS教程100例-005:自定义对话框Ext.MessageBox.show
我们对ExtJS对话框进行了三篇演示: MessageBox的三种用法 进度条对话框Ext.MessageBox.progress 等待对话框Ext.MessageBox.wait 通过上面三篇内容的 ...
- 实用ExtJS教程100例-004:等待对话框Ext.MessageBox.wait
在前面两节中,我们分别演示了ExtJS三种常用的对话框和ExtJS带有进度条的对话框.在本节内容中,我们来看看ExtJS中的等待对话框. 首先来看一个简单的例子[查看在线示例]: 这种对话框会一直滚动 ...
- 实用ExtJS教程100例-003:进度条对话框Ext.MessageBox.progress
在上一篇内容中我们介绍了三种常用的MessageBox提示框,在这篇文章中,我们将演示如何在对话框中使用进度条. 进度条对话框 我们可以使用下面的代码来在MessageBox中显示一个进度条: Ext ...
随机推荐
- unity, eulerAngle
unity中欧拉角规定如下: A rotation that rotates euler.z degrees around the z axis, euler.x degrees around the ...
- ManifoldJS
微软推出开源工具ManifoldJS,可以自动将Web App转换成各种平台的App(安卓.iOS.Chrome OS.Windows). ManifoldJS通过获取网站meta-data信息,即可 ...
- Python 2.x与3.x共存
(1)检查在Path环境变量中是否有以下4个变量(没有则添加): 1.c:\Python27 2.c:\Python27\Scripts 3.c:\Python35 4.c:\Python35\Scr ...
- 数据导出至Excel文件--好库编程网http://code1.okbase.net/codefile/SerializeHelper.cs_2012122018724_118.htm
using System; using System.IO; using System.Data; using System.Collections; using System.Data.OleDb; ...
- 简单实现JS Loading功能
我们经常在浏览网页的时候会看到数据在加载时,出现的LOADING提示.其实这个功能原理是很简单的,就是一个DIV遮盖当前页面,然后Loading就在遮盖DIV层上展示出来,现在我们来动手实现一下. 1 ...
- 异机恢复 RMAN-06023: no backup or copy of datafile 17 found to restore
前不久因工作需要使用RMAN异机恢复,很基础也很具有代表性和普遍性,希望对需要的人有所帮助. 具体过程如下: 先拷贝原库的口令文件和参数文件到备库. 然后使用如下脚本对原库进行备份: run { al ...
- C++11中的Lambda表达式
原文地址:C++中的Lambda表达式 作者:果冻想 一直都在提醒自己,我是搞C++的:但是当C++11出来这么长时间了,我却没有跟着队伍走,发现很对不起自己的身份,也还好,发现自己也有段时间没有写C ...
- 【原】Centos 7 下创建LVM流程
阅读目录 个主分区,1个扩展分区] 或 [4个主分区],扩展分区又可以有多个分区: window常见的分配方式: 方式1:[1个主分区(C盘)+1个扩展分区(包括3个分区,D,E, ...
- 51nod 1348 乘积之和
用(r-l+2)维向量f[l,r]表示区间[l,r]内选i个数(0<=i<=r-l+1)相乘的所有方案之和,可以发现f[l,r]=f[l,m]*f[m+1,r],题目模数100003较小, ...
- 返回顶部(解决IE6固定定位)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...