<%@ page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>onReady</title>
<link rel="stylesheet" type="text/css"
href="/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/ext/ext-all.js"></script>
<script type="text/javascript">
function myAlert()
{
//alert(title, msg ,function(){})
//其中title,msg為必選參數(shù),function為可選參數(shù),在關(guān)閉彈出窗口后觸發(fā)。
Ext.MessageBox.alert("title","msg",function(){alert("關(guān)閉對話框后彈出!")});
}
function myConfirm()
{
//clickValue是點擊后返回的值
Ext.MessageBox.confirm("title","msg",function(clickValue){alert(clickValue);});
}
function myPrompt()
{
//true為多行,this表示作用域
Ext.MessageBox.prompt("title","msg",function(e,text){alert(e+"-"+text);},this,true);
}
function myShow()
{
Ext.MessageBox.show({
title:"標(biāo)題",
msg:"內(nèi)容的消息",
buttons:{"ok":"我不再顯示OK了"},
fn:function(e){alert(e);},
animEl:"test1",
width:500,
icon:Ext.MessageBox.INFO,
closable:false,
progress:true,
wait:true,
progressText:"進(jìn)度條"
//prompt:true
//multiline:true
});
}
Ext.onReady(myShow);
</script>
</head>
<body style="font:10px;color:red;">
<div id="test1">Ext.MessageBox.show</div>
<div>
1.animEl:對話框彈出和關(guān)閉時的動畫效果,比如設(shè)置為“id1”,則從id1處彈出并產(chǎn)生動畫,收縮則相反<br/>
2.buttons:彈出框按鈕的設(shè)置,主要有以下幾種:Ext.Msg.OK,Ext.Msg.OKCANCEL,Ext.Msg.CANCEL,Ext.Msg.YESNO,Ext.Msg.YESNOCANCEL,你也可以自定義按鈕上面的字:{"ok","我本來是ok的"}。若設(shè)為false,則不顯示任何按鈕.<br/>
3.closable:如果為false,則不顯示右上角的小叉叉,默認(rèn)為true。<br/>
4.msg:"消息的內(nèi)容"<br/>
5.title:"標(biāo)題"<br/>
6.fn:關(guān)閉彈出框后執(zhí)行的函數(shù)<br/>
7.icon:彈出框內(nèi)容前面的圖標(biāo),取值為Ext.MessageBox.INFO,Ext.MessageBox.ERROR,Ext.MessageBox.WARNING,Ext.MessageBox.QUESTION<br/>
8.width:彈出框的寬度,不帶單位<br/>
9.prompt:設(shè)為true,則彈出框帶有輸入框<br/>
10.multiline:設(shè)為true,則彈出框帶有多行輸入框<br/>
11.progress:設(shè)為true,顯示進(jìn)度條,(但是是死的)<br/>
12.progressText:顯示在進(jìn)度條上的字<br/>
13.wait:設(shè)為true,動態(tài)顯示progress<br/>
14.waitConfig:配置參數(shù),以控制顯示progress<br/>
</div>
</body>
</html>