我创建了面板如下
Ext.define('MyApp.view.DatePanel', {
extend: 'Ext.Panel',
alias: 'widget.DatePanel',
config: {
itemid:'DatePanel',
modal:true,
centered: true,
width:'320px',
height:'110px',
items:[
{
xtype: 'datepickerfield',
label: 'Select date',
type:'date',
itemId: 'rptDate',
value: new Date(),
},
{
xtype:'toolbar',
docked:'bottom',
items:[{
text:'OK',
ui:'confirm',
action:'ShowTurnOverReport'
},
{
text:'Cancel',
ui:'confirm',
action:'Cancel'
}
}
]
}
});
我使用下面的代码将此面板显示为弹出窗口
Ext.Viewport.add({xtype: 'DatePanel'});
现在在按钮取消单击我想隐藏/删除它
我试过了
Ext.Viewport.remove(Datepanel),
var pnl = Ext.getCmp('DatePanel');
pnl.hide();
但没有任何效果。我怎样才能做到这一点 ??