Ext.MessageBox(1)

  1:提示框(Ext.MessageBox.alert  或  Ext.Msg.alert)

         alertString title, String msg, [Function fn], [Object scope] );

         title:标题

         msg:显示内容

         fn:回调函数

         scope:作用域

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ExtJs整理</title>
<link rel="stylesheet" type="text/css" href="ExtJs/resources/css/ext-all.css">
<script type="text/javascript" src="ExtJs/adapter/ext-base.js"></script>
<script type="text/javascript" src="ExtJs/ext-all.js"></script>
<script type="text/javascript" src="ExtJs/src/locale/ext-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
    Ext.onReady(function(){
		Ext.MessageBox.alert("Alert", "弹出窗口Alert", function(){
			alert("恭喜你居然点击确定按钮!");
		});
	});
</script>
<body>
</body>
</html>


运行结果

Ext.MessageBox(1)_第1张图片

然后点击确定

Ext.MessageBox(1)_第2张图片

 

 

2:对话框(Ext.MessageBox.confirm  或  Ext.Msg.confirm)

       confirm( String title, String msg, [Function fn], [Object scope] )

       title:标题

       msg:显示内容

       fn:回调函数

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ExtJs整理</title>
<link rel="stylesheet" type="text/css" href="ExtJs/resources/css/ext-all.css">
<script type="text/javascript" src="ExtJs/adapter/ext-base.js"></script>
<script type="text/javascript" src="ExtJs/ext-all.js"></script>
<script type="text/javascript" src="ExtJs/src/locale/ext-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
    Ext.onReady(function(){
		Ext.MessageBox.confirm("请确定", "是否要删除这个美女?", function(button, text){
			alert(button);
		});
	});
</script>
<body>
</body>
</html>


运行如下显示

Ext.MessageBox(1)_第3张图片

点击是按钮Ext.MessageBox(1)_第4张图片               点击否按钮Ext.MessageBox(1)_第5张图片

 

你可能感兴趣的:(Ext.MessageBox(1))