对于任何人来说,一种解决方案是minimizable
使用tools
. 这是完整的例子..
var isMinimized = false; //if you want to check for minimized elsewhere..
var winWidth; //to restore to actual width.
Ext.create('Ext.window.Window', {
title: 'Hello',
closable : false,
width : 300, height : 400,
tools: [
{
type: 'restore',
hidden : true,
handler: function( evt,toolEl,owner,tool ) {
var window = owner.up( 'window' );
window.expand('',false);
window.setWidth(winWidth);
window.center();
isMinimized = false;
this.hide();
this.nextSibling().show();
}
},{
type: 'minimize',
handler: function( evt,toolEl,owner,tool ){
var window = owner.up( 'window' );
window.collapse();
winWidth = window.getWidth();
window.setWidth( 150 );
window.alignTo( Ext.getBody(), 'bl-bl');
this.hide();
this.previousSibling().show();
isMinimized = true;
}
}
]
}).show();