show()
打开一个窗口,并且仅在新打开的窗口关闭后才返回。
当 window 类实例化时,默认情况下它是不可见的。show 显示一个窗口并立即返回,而不等待该窗口关闭。因此,打开的窗口不会阻止用户与应用程序中的其他窗口交互。这种类型的窗口称为“无模式”窗口。无模式窗口的常见示例包括属性窗口、工具箱和调色板。若要限制用户与特定窗口交互,必须通过调用 showdialog 来打开窗口。
通过调用 show 打开的窗口不会自动与打开它的窗口产生关系;具体说来,打开的窗口不知道是哪个窗口将它打开。可以使用 owner 属性来建立这种关系,并使用 ownedwindows 属性对其进行管理。
调用 show 可以实现与将 window 对象的 visibility 属性设置为 visible 相同的最终结果。但是,从计时角度来看,两者之间存在区别。
看个自定的show
<script language=网页特效>
function opendialogwin()
{
var result = window.showmodaldialog("showmessage.asp教程x","","dialogheight:160px; dialogwidth:300px; status:no; help:no; scroll:no");
//window.show('showmessage.aspx', '','height=300, width=400, top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no','_blank');
if(result == "yes")
window.alert("you clicked yes!");
else if(result == "no")
window.alert("you clicked no!");
//document.writeln(result);
}
</script><input type=button value="按钮" name="btn" /> response.write("<script language='javascript'>");
response.write("function confirm(){ window.returnvalue='yes';window.close(); }");
response.write("function cancel(){ window.returnvalue='no';window.close(); }");
response.write("</script>");
response.write("<div align='center'><input type='button' value='yes' onclick='confirm()' /><input type='button' value='no' onclick='cancel()' /></div>");
showdialog()
showdialog(msg, mode, t, func, cover)
msg
对话框内容
mode
对话框模式
info 没有按钮 一般信息
notice 有确定按钮 通知信息
alert 有确定按钮 错误信息
confirm 有确定和取消按钮 确认信息
t
对话框标题
func
点“确定”执行的函数 可以是一个函数(推荐)也可以是一段 js 代码
cover
是否覆盖整个页面 1:是 0:否 一般信息 cover 默认值是 0 其他信息 cover 默认值是 1
打开一个窗口,并且仅在新打开的窗口关闭后才返回。
当 window 类实例化时,默认情况下它是不可见的。showdialog 显示窗口,禁用应用程序中的所有其他窗口,并且仅在窗口关闭后才返回。这种类型的窗口称为“模式”窗口。
模式窗口主要用作对话框。对话框是一种特殊类型的窗口,应用程序使用它们与用户交互以完成任务,例如打开文件或打印文档。对话框通常允许用户在关闭对话框之前接受或取消向其显示的任务。showdialog 返回一个 nullable<(of <(t>)>)boolean 值,该值指定活动被接受还是被取消。返回值是 dialogresult 属性在窗口关闭前具有的值。
通过调用 showdialog 方法打开的窗口不会自动与打开它的窗口产生关系;具体说来,打开的窗口不知道是哪个窗口将它打开。可以使用 owner 属性来建立这种关系,并使用 ownedwindows 属性对其进行管理。若要支持 ui 自动化,必须为通过调用 showdialog 打开的窗口设置 owner。
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>查询</title>
<link rel="stylesheet" type="text/css教程" href="css/ext-all.css" />
<script type="text/javascript" src="js/ext-base.js"></script>
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript" src="filter.js"></script>
</head>
<body>
<input type="button" id="show-dialog-btn" value="过滤条件" /><br /><br />
<div id="filter-dlg" style="visibility:hidden;">
<div class="x-dlg-hd">过滤条件</div>
</div>
</body>
</html>filter.js
var filter = function(){
ext.quicktips教程.init();
ext.form.field.prototype.msgtarget = 'side';
var dialog, showbtn;
var toggletheme = function(){
ext.get(document.body, true).toggleclass('xtheme-gray');
};return {
init : function(){
showbtn = ext.get('show-dialog-btn');
showbtn.on('click', this.showdialog, this);
},
showdialog : function(){
if(!dialog){
dialog = new ext.layoutdialog("filter-dlg", {
modal:true,
width:600,
height:400,
shadow:true,
minwidth:300,
minheight:300,
proxydrag: true,
center: {
autoscroll:true,
tabposition: 'top',
closeo教程ntab: true,
alwaysshowtabs: false
}
});
var layout = dialog.getlayout();
layout.beginupdate();
layout.add('center', new ext.contentpanel(ext.id(), {autocreate:true, background:true}));
layout.endupdate();dialog.addkeylistener(27, dialog.hide, dialog);
dialog.addbutton('确定', dialog.hide, dialog);
dialog.addbutton('重填', dialog.hide, dialog);var filter = new ext.form.form({
id: 'filter',
labelalign: 'right',
labelwidth: 80,
url: 'query-sms.jsp教程'
});filter.fieldset(
{legend:''},new ext.form.datefield({
fieldlabel: '起始时间',
name: 'begin',
width:180,
format:'y-m-d h:i:s',
allowblank:false
}),new ext.form.datefield({
fieldlabel: '终止时间',
name: 'end',
width:180,
format:'y-m-d h:i:s',
allowblank:false
})
);filter.render(dialog.body);
}
dialog.show(showbtn.dom);
}
};
}();ext.eventmanager.ondocumentready(filter.init, filter, true);
联系客服