就弹出的window关闭后再打开窗口会不断叠加,我已经设置了判断怎么还不行
js代码
<script language="javascript">
function show(){ var DetailForm = new Ext.FormPanel({
bodyStyle:'padding:5 5 5 5',
labelSeparator : ":",//元素分隔符为:
frame:true,
width:500,
height:'auto',
border:false,//无边框
items : [
{
xtype:'textfield',
width : 200,
readOnly:true,
name : 'table_number',//定义元素名称
fieldLabel:'就餐桌号'
},{
xtype:'textfield',
width:200,
readOnly:true,
name : 'table_time',//定义元素名称
fieldLabel:'到桌时间'
},{
xtype:'textfield',
width:200,
readOnly:true,
name : 'table_time',//定义元素名称
fieldLabel:'上菜时间'
},{
xtype:'textarea',
width:200,
readOnly:true,
grow:true,
preventScrollbars:true,
name : 'table_vagetable',//定义元素名称
fieldLabel:'所点菜品'
},{
xtype:'textfield',
width:200,
name : 'table_totalPrice',//定义元素名称
fieldLabel:'总价'
},{
xtype:'textfield',
width:100,
name : 'table_ifVip',//定义元素名称
value:'是',
fieldLabel:'是否VIP'
}
],buttonAlign:'right',
buttons:[{
text:'关闭',
handler: function(){
win.hide();
}
}]
});
var win;
if(!win){ win=new Ext.Window({
el: 'hello-win',
layout: 'fit',
width: 350,
title: '桌台详情',
height: 400,
closeAction: 'hide',
resizable : false,
shadow : true,
modal :true,
closable:true,//有关闭按钮
bodyStyle:'padding:5 5 5 5',
animCollapse:true,
items:[DetailForm]
});
}
win.show();
}
</script>html部分:
<a href="#" id="detail" onclick="show()">详细</a>
js代码
<script language="javascript">
function show(){ var DetailForm = new Ext.FormPanel({
bodyStyle:'padding:5 5 5 5',
labelSeparator : ":",//元素分隔符为:
frame:true,
width:500,
height:'auto',
border:false,//无边框
items : [
{
xtype:'textfield',
width : 200,
readOnly:true,
name : 'table_number',//定义元素名称
fieldLabel:'就餐桌号'
},{
xtype:'textfield',
width:200,
readOnly:true,
name : 'table_time',//定义元素名称
fieldLabel:'到桌时间'
},{
xtype:'textfield',
width:200,
readOnly:true,
name : 'table_time',//定义元素名称
fieldLabel:'上菜时间'
},{
xtype:'textarea',
width:200,
readOnly:true,
grow:true,
preventScrollbars:true,
name : 'table_vagetable',//定义元素名称
fieldLabel:'所点菜品'
},{
xtype:'textfield',
width:200,
name : 'table_totalPrice',//定义元素名称
fieldLabel:'总价'
},{
xtype:'textfield',
width:100,
name : 'table_ifVip',//定义元素名称
value:'是',
fieldLabel:'是否VIP'
}
],buttonAlign:'right',
buttons:[{
text:'关闭',
handler: function(){
win.hide();
}
}]
});
var win;
if(!win){ win=new Ext.Window({
el: 'hello-win',
layout: 'fit',
width: 350,
title: '桌台详情',
height: 400,
closeAction: 'hide',
resizable : false,
shadow : true,
modal :true,
closable:true,//有关闭按钮
bodyStyle:'padding:5 5 5 5',
animCollapse:true,
items:[DetailForm]
});
}
win.show();
}
</script>html部分:
<a href="#" id="detail" onclick="show()">详细</a>
解决方案 »
- 麻烦大家帮我看一下这段代码,为什么alert不好用呢??!! 我想要做两次密码不同就警示和不输入完整信息就警示的操作!
- prototype里的函数不能直接用吗
- 高手请进 帮个忙 如何实现动态创建BOX盒子模型 急在在线等。。。。
- 用web dynpo for java 开发的系统,我的IE进入系统后点击增加等按钮,没反应
- 鼠标右键的问题
- 高手进,正则表达式限制只能输入数(包括小数)没分了:(
- 遇到一个问题,不知道怎么表达好,贴一小段代码
- 请问各位大侠,如何在一个表单提交后弹出报错窗口?(需要用自已做的页面代替系统的弹出窗口)
- javascript中怎么禁止IE的打印功能
- JS 截取字符串 包括空格 怎么截
- jquery隔行变色
- 如何取得浮动框架内页面的源代码?
第一种:
function show() { var DetailForm = new Ext.FormPanel({
bodyStyle : 'padding:5 5 5 5',
labelSeparator : ":",// 元素分隔符为:
frame : true,
width : 500,
height : 'auto',
border : false,// 无边框
items : [{
xtype : 'textfield',
width : 200,
readOnly : true,
name : 'table_number',// 定义元素名称
fieldLabel : '就餐桌号'
}, {
xtype : 'textfield',
width : 200,
readOnly : true,
name : 'table_time',// 定义元素名称
fieldLabel : '到桌时间'
}, {
xtype : 'textfield',
width : 200,
readOnly : true,
name : 'table_time',// 定义元素名称
fieldLabel : '上菜时间'
}, {
xtype : 'textarea',
width : 200,
readOnly : true,
grow : true,
preventScrollbars : true,
name : 'table_vagetable',// 定义元素名称
fieldLabel : '所点菜品'
}, {
xtype : 'textfield',
width : 200,
name : 'table_totalPrice',// 定义元素名称
fieldLabel : '总价'
}, {
xtype : 'textfield',
width : 100,
name : 'table_ifVip',// 定义元素名称
value : '是',
fieldLabel : '是否VIP'
}],
buttonAlign : 'right',
buttons : [{
text : '关闭',
handler : function() {
win.close();//-------------改为close------------
}
}]
});
var win;
if (!win) {
win = new Ext.Window({
renderTo : 'hello-win',//-------------改为renderTo win不存在就渲染------------
layout : 'fit',
width : 350,
title : '桌台详情',
height : 400,
closeAction : 'hide',
resizable : false,
shadow : true,
modal : true,
closable : true,// 有关闭按钮
bodyStyle : 'padding:5 5 5 5',
animCollapse : true,
items : [DetailForm]
});
}
win.show();}
var win;
function show(){ var DetailForm = new Ext.FormPanel({
bodyStyle:'padding:5 5 5 5',
labelSeparator : ":",//元素分隔符为:
frame:true,
width:500,
height:'auto',
border:false,//无边框
items : [
{
xtype:'textfield',
width : 200,
readOnly:true,
name : 'table_number',//定义元素名称
fieldLabel:'就餐桌号'
},{
xtype:'textfield',
width:200,
readOnly:true,
name : 'table_time',//定义元素名称
fieldLabel:'到桌时间'
},{
xtype:'textfield',
width:200,
readOnly:true,
name : 'table_time',//定义元素名称
fieldLabel:'上菜时间'
},{
xtype:'textarea',
width:200,
readOnly:true,
grow:true,
preventScrollbars:true,
name : 'table_vagetable',//定义元素名称
fieldLabel:'所点菜品'
},{
xtype:'textfield',
width:200,
name : 'table_totalPrice',//定义元素名称
fieldLabel:'总价'
},{
xtype:'textfield',
width:100,
name : 'table_ifVip',//定义元素名称
value:'是',
fieldLabel:'是否VIP'
}
],buttonAlign:'right',
buttons:[{
text:'关闭',
handler: function(){
win.hide();
}
}]
}); if(!Ext.get('hello-win')){ win=new Ext.Window({
el: 'hello-win',
layout: 'fit',
width: 350,
title: '桌台详情',
height: 400,
closeAction: 'hide',
resizable : false,
shadow : true,
modal :true,
closable:true,//有关闭按钮
bodyStyle:'padding:5 5 5 5',
animCollapse:true,
items:[DetailForm]
});
}
win.show();
}
</script>
function show() { var DetailForm = new Ext.FormPanel({
bodyStyle : 'padding:5 5 5 5',
labelSeparator : ":",// 元素分隔符为:
frame : true,
width : 500,
height : 'auto',
border : false,// 无边框
items : [{
xtype : 'textfield',
width : 200,
readOnly : true,
name : 'table_number',// 定义元素名称
fieldLabel : '就餐桌号'
}, {
xtype : 'textfield',
width : 200,
readOnly : true,
name : 'table_time',// 定义元素名称
fieldLabel : '到桌时间'
}, {
xtype : 'textfield',
width : 200,
readOnly : true,
name : 'table_time',// 定义元素名称
fieldLabel : '上菜时间'
}, {
xtype : 'textarea',
width : 200,
readOnly : true,
grow : true,
preventScrollbars : true,
name : 'table_vagetable',// 定义元素名称
fieldLabel : '所点菜品'
}, {
xtype : 'textfield',
width : 200,
name : 'table_totalPrice',// 定义元素名称
fieldLabel : '总价'
}, {
xtype : 'textfield',
width : 100,
name : 'table_ifVip',// 定义元素名称
value : '是',
fieldLabel : '是否VIP'
}],
buttonAlign : 'right',
buttons : [{
text : '关闭',
handler : function() {
win.hide();
}
}]
});
var win = Ext.getCmp('myWin'); //------------要这样判断win 之前那样永远走进if分支
if (!win) {
win = new Ext.Window({
el : 'hello-win',
id:'myWin', //---------加个id
layout : 'fit',
width : 350,
title : '桌台详情',
height : 400,
closeAction : 'hide',
resizable : false,
shadow : true,
modal : true,
closable : true,// 有关闭按钮
bodyStyle : 'padding:5 5 5 5',
animCollapse : true,
items : [DetailForm]
});
}
win.show();}