-
26 Nov 2008 7:24 PM #1
beforeresize
beforeresize
I want to do something before the size of panel changing.
But Panel don't support the event of beforesize.
Please give me some suggestions.
Thank you!
-
26 Nov 2008 7:31 PM #2
I can only think to extend the Panel and add ur function before the resize event
-
26 Nov 2008 7:45 PM #3
I try to addEvent({'beforeresize',true});
But I don't know where to fireEvent('beforeresize');
-
26 Nov 2008 7:45 PM #4
What is the desired end result?
What is the desired end result?
Not sure how you will override the resize event.
What do you want to do before the resize - do you want to stop/ disallow the resize?
There may be a way to accomplish your desired end result without a before resize event.Joseph Francis,
CoreLan / Meeting Consultants
-
26 Nov 2008 7:54 PM #5
Thank you!
I don't want to stop/ disallow the event of resize.
when the panel resize, I want to get the size of panel before the panel changing
-
26 Nov 2008 9:18 PM #6
Maybe this ...
Maybe this ...
Not sure this will work / help but - if you have a variable that gets the size of the panel on load using myPanel.getSize() (i.e. origSize = myPanel.getSize()) then after the resize event - that would still have the original size (i.e. origSize.width and origSize.height).
You could process as needed and once done, set origSize to the new panel size for the next resize event to have the old value.Joseph Francis,
CoreLan / Meeting Consultants
-
28 Nov 2008 1:36 AM #7
heh? isn't the resize event already provide u with the panel size before it's resized?
so if my understanding is correct u can do:HTML Code:resize : ( Ext.Component this, Number adjWidth, Number adjHeight, Number rawWidth, Number rawHeight ) Fires after the component is resized. Fires after the component is resized. Listeners will be called with the following arguments: this : Ext.ComponentadjWidth : NumberThe box-adjusted width that was setadjHeight : NumberThe box-adjusted height that was setrawWidth : NumberThe width that was originally specifiedrawHeight : NumberThe height that was originally specified
Code:yourpanel.on('resize',function(panel,newwidth,newheight,oldwidth,oldheight){ //wat to do with oldwidth and oldheight ? });


Reply With Quote

