extjs4 window 从父页面弹出
时间: 2023-08-26 18:40:05 浏览: 133
您好!要将 ExtJS4 窗口从父页面弹出,您可以按照以下步骤操作:
1. 在父页面中定义一个函数,用于创建并显示子窗口,如:
```
function openChildWindow() {
Ext.create('Ext.window.Window', {
title: '子窗口',
width: 300,
height: 200,
layout: 'fit',
items: [{
xtype: 'panel',
html: '这是子窗口'
}]
}).show();
}
```
2. 在父页面中创建一个按钮,用于触发打开子窗口的函数,如:
```
Ext.create('Ext.button.Button', {
text: '打开子窗口',
handler: function() {
openChildWindow();
}
});
```
3. 在子窗口中设置`opener`属性为父页面的`window`对象,如:
```
Ext.create('Ext.window.Window', {
title: '子窗口',
width: 300,
height: 200,
layout: 'fit',
opener: window.opener, // 设置opener属性为父页面的window对象
items: [{
xtype: 'panel',
html: '这是子窗口'
}]
}).show();
```
这样就可以将子窗口从父页面弹出了。希望对您有所帮助!
阅读全文
相关推荐















