Extjs 各种弹出框的使用

时间:13-05-13 栏目:EXTJS 作者:zongyan86 评论:0 点击: 12,033 次

Ext.onReady(function () {

//第一个例子

// var dog = {
// name: '旺财',
// age: 2,
// type: '微笑天使'
// };
// Ext.MessageBox.alert("hello world!", dog.name + "是" + dog["type"], function () {
// alert("萨摩耶你好!");
// }, this);

//第二个例子
// Ext.MessageBox.confirm("hello world!", dog.name + "是" + dog["type"], function (btn) {
// if (btn == 'yes') {
// alert("萨摩耶你好!");
// }
// }, this);

//第三个例子
// Ext.MessageBox.prompt("hello world!", dog.name + "是" + dog["type"], function (btn, msg) {
// alert(msg);
// }, this, true, "你喜欢这只小狗嘛?");

//第四个例子
// Ext.MessageBox.wait("loading...", "info");

//第五个例子
// var timer = Ext.MessageBox.show({
// title: "当前时间",
// width: 400,
// msg: "时间是:",
// buttons: Ext.Msg.YESNO,
// fn: function (btn) {
// if (btn == 'yes') {
// Ext.TaskManager.stop(t);
// }
// }
// });
// var t = {
// run: function () {
// timer.updateText("当前时间是:" + Ext.util.Format.date(new Date(), 'Y-m-d g:i:s'));
// },
// interval: 1000
// };
// Ext.TaskManager.start(t);
//第六个例子
var progress = Ext.MessageBox.show({
title: "进度条",
width: 400,
msg: "当前时间",
progress: true
});
var index = 0;
var t = {
run: function () {
progress.updateProgress(index / 100, "当前已完成" + index + "%", '请等待');
index += 5;
if (index > 100) {
Ext.TaskManager.stop(t);
progress.hide();
}
},
interval: 1000
};
Ext.TaskManager.start(t);

});

web技术分享



声明: 本文由( zongyan86 )原创编译,转载请保留链接: Extjs 各种弹出框的使用

关注我们