Ext.MessageBox

<link rel="stylesheet" type="text/css" href="extjs2.3/resources/css/ext-all.css" />
		<script type="text/javascript" src="extjs2.3/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="extjs2.3/ext-all.js"></script>
	
		<script type="text/javascript">

			Ext.onReady(function(){
				
				Ext.get('btn1').on('click',function(){
					Ext.Msg.alert('alert',"alert对话框");
				});
				
				Ext.get('btn2').on('click',function(){
					Ext.Msg.confirm("请确认","是否删除?",function(button,text){
						if(button=="yes"){
							Ext.Msg.alert("info","确认删除");
						}
					});
				});
				
				Ext.get('btn3').on('click',function(){
					Ext.Msg.prompt("输入提示框","请输入您的姓名:",function(button,text){
						if(button=="ok"){
							Ext.Msg.alert("info","您输入的姓名为:"+text);
						}else{
							Ext.Msg.alert("info","对不起,您放弃了输入");
						}
					});
				});
				
				Ext.get('btn4').on('click',function(){
					Ext.Msg.show({
						title:"提示框",
						msg:"是否需要保存更改的资料",
						buttons:Ext.Msg.YESNOCANCEL,
						icon:Ext.Msg.QUESTION,
						//按钮响应函数
						fn:toDo
					});
				});
				
			});
			
			function toDo(button){
				if(button=="yes"){
					Ext.Msg.alert("info","保存");
				}else if(button=="no"){
					Ext.Msg.alert("info","不保存");
				}else{
					Ext.Msg.alert("info","取消操作");
				}
			}
			
		</script>
 
<input type="button" id="btn1" value="alert对话框" />
<input type="button" id="btn2" value="confirm对话框" />
<input type="button" id="btn3" value="prompt对话框" />
<input type="button" id="btn4" value="自定义对话框" />
 

你可能感兴趣的:(message)