PDA

View Full Version : Windows maximize and restore



Chap
7 Sep 2009, 7:14 PM
Hi,

A window contains a tabPanel. When the window resize, the tabpanel will auto fit the window. So I want to get the tabPanel's size value after window resize. I get the value at the event 'resize', it vertified ok when the window resize, but maximize and restore. I debugger the window maximize function in ext-all-debug.js, and get the screen print show below fig. It seems a asynchronism process. How should I do to get the size value of tabpane? Thanks all



Ext.onReady(function(){
var win;
var tabPanel;
if(!win){
tabPanel = new Ext.TabPanel({
applyTo: 'hello-tabs',
autoTabs:true,
activeTab:0,
deferredRender:false,
border:false
});
win = new Ext.Window({
// applyTo:'hello-win',
layout:'fit',
width:500,
height:300,
closeAction:'hide',
plain: true,
maximizable: true,
items: tabPanel,
buttons: [{
text:'Submit',
disabled:true
},{
text: 'Close',
handler: function(){
win.hide();
}
}]
});

win.on('resize', function(win, w, h){
alert(w + ':' + h + '/' + tabPanel.body.getSize().width + ':' + tabPanel.body.getSize().height);
}, this);
win.on('maximize', function(win){
alert(tabPanel.body.getSize().width + ':' + tabPanel.body.getSize().height);
}, this);
win.on('restore', function(win){
alert(tabPanel.body.getSize().width + ':' + tabPanel.body.getSize().height);
}, this);
}
win.show();
});

http://www.extjs.com/forum/attachment.php?attachmentid=16100&stc=1&d=1252378735