Extjs的window控件始终居中的显示问题

在浏览器改变大小的时候,希望实现Extjs中的window控件在页面上始终居中,如果实现。请教

[code="java"]
var currentWindow;
Ext.EventManager.onWindowResize(function(){
if(currentWindow){
currentWindow.setHeight(document.body.clientHeight * 0.8 );
currentWindow.setWidth(document.body.clientWidth * 0.8 );
currentWindow.center();
}
});

//Ext.EventManager.onWindowResize(abcresize);

    var win = new Ext.Window({
        title    : 'Layout Window',
        closable : true,
        width    : 600,
        height   : 350,
        //border : false,
        plain    : true,
        layout   : 'border',
        items    : [nav, tabs]
    });
win.addListener('beforeshow',function(o){   
    currentWindow=o;
}); 
win.addListener('destroy',function(o){  
    currentWindow=null;
});

    win.show(button);

[/code]

我可是测试过的,更复杂的应用按照这个思路继续下去

很不错,实际受到启发的是这一段代码:
Ext.EventManager.onWindowResize(function(){

……
});