<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>msgbox.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<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">
Ext.onReady(function(){
Ext.get('confirm').on('click',function(){
Ext.Msg.confirm("提示","你确定要执行该操作吗?",callbackMsg);
});
Ext.get('info').on('click',function(){
Ext.Msg.show(
{
title:"提示",
msg:"操作成功!",
fn:callbackMsg,
buttons:Ext.MessageBox.OK,
icon:Ext.MessageBox.INFO,
animEl:'info'
});
});
Ext.get('warn').on('click',function(){
Ext.Msg.show(
{
title:"提示",
msg:"此操作可能存在安全隐患!",
fn:callbackMsg,
buttons:Ext.MessageBox.OK,
icon:Ext.MessageBox.WARNING,
animEl:'warn'
});
});
Ext.get('error').on('click',function(){
Ext.Msg.show(
{
title:"提示",
msg:"连接服务器失败,请检查网络!",
fn:callbackMsg,
buttons:Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR,
animEl:'error'
});
});
Ext.get('oneline_prompt').on('click',function(){
Ext.Msg.prompt("提示","请输入姓名:",inputMsg);
});
Ext.get('multiLine_prompt').on('click',function(){
Ext.MessageBox.show({
title: '提示',
msg: '请输入聊天内容:',
width:300,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: inputMsg,
animEl: 'multiLine_prompt'
});
});
Ext.get('question').on('click',function(){
Ext.MessageBox.show({
title: '提示',
msg: '要执行该操作吗?',
width:300,
buttons: Ext.MessageBox.OKCANCEL,
icon:Ext.Msg.QUESTION,
fn: callbackMsg,
animEl: 'question'
});
});
callbackMsg = function(btn) {
Ext.Msg.show({msg:"You clicked " + btn});
}
inputMsg = function(btn,txt) {
Ext.Msg.show({msg:"You input:"+txt});
}
Ext.get('test').on('click',function(){
var f = Ext.Msg.confirm("","ok?",callbackMsg);
});
});
</script>
</head>
<body>
<input type="button" id="confirm" value="Confirm">
<input type="button" id="question" value="Question">
<input type="button" id="info" value="Info">
<input type="button" id="warn" value="Warn">
<input type="button" id="error" value="Error">
<input type="button" id="oneline_prompt" value="OneLinePrompt">
<input type="button" id="multiLine_prompt" value="MultiLinePrompt">
<input type="button" id="test" value="test">
</body>
</html>
ext--消息框2
最新推荐文章于 2021-04-10 20:12:22 发布