模态窗口默认添加到正文中。但是,我想在添加按钮单击事件时在面板内添加一个模式窗口。我必须添加什么代码。任何人都可以提出一个想法。
模态窗口代码:
self.sampleWindow = Ext.create("Ext.window.Window", {
title: 'Add Deals',
layout: 'vbox',
closeAction: 'hide',
padding: 10,
cls: 'custom-modal',
constrain:'true',
height: (mq.matches)?"77%":"70%",
width: (mq.matches)?"67%":"60%",
margin:'31 0 0 -36',
scrollable : true,
items: [self.buildSample(),
self.buildSampleGrid()],
listeners:{
hide:function(win){
win.close();
}
}
});
面板代码:
var panel1 = Ext.create("Ext.panel.Panel",{
id: 'dealInformationblock',
minHeight:10,
padding: 10,
margin:(nq.matches)?'10 30 5 10':'10 10 5 0',
cls: ['innerCard','card-layout-border'],
layout:{
type: 'vbox',
align: 'center'
},
items:[
SampleInformation
]
})
return panel1;
上面的模态窗口应放置在 panel1 内。
最佳答案
使用 showAt( x, [y] )
显示窗口。x & y 应该是面板内部的值。
关于javascript - 如何在 EXTJS 中添加位于另一个网格面板内的 Ext.window.window 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38100202/