1. #1
    Ext User
    Join Date
    Jul 2008
    Location
    China
    Posts
    74
    Vote Rating
    0
    joehebe is on a distinguished road

      0  

    Question 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!

  2. #2
    Sencha Premium Member teddyjas's Avatar
    Join Date
    Dec 2007
    Location
    Singapore
    Posts
    262
    Vote Rating
    0
    teddyjas is on a distinguished road

      0  

    Default


    I can only think to extend the Panel and add ur function before the resize event

  3. #3
    Ext User
    Join Date
    Jul 2008
    Location
    China
    Posts
    74
    Vote Rating
    0
    joehebe is on a distinguished road

      0  

    Default


    I try to addEvent({'beforeresize',true});
    But I don't know where to fireEvent('beforeresize');

  4. #4
    Ext User Joe's Avatar
    Join Date
    Apr 2007
    Posts
    243
    Vote Rating
    0
    Joe is on a distinguished road

      0  

    Default 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

  5. #5
    Ext User
    Join Date
    Jul 2008
    Location
    China
    Posts
    74
    Vote Rating
    0
    joehebe is on a distinguished road

      0  

    Default


    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

  6. #6
    Ext User Joe's Avatar
    Join Date
    Apr 2007
    Posts
    243
    Vote Rating
    0
    Joe is on a distinguished road

      0  

    Default 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

  7. #7
    Sencha Premium Member teddyjas's Avatar
    Join Date
    Dec 2007
    Location
    Singapore
    Posts
    262
    Vote Rating
    0
    teddyjas is on a distinguished road

      0  

    Default


    Quote Originally Posted by joehebe View Post
    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
    heh? isn't the resize event already provide u with the panel size before it's resized?

    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
    so if my understanding is correct u can do:
    Code:
    yourpanel.on('resize',function(panel,newwidth,newheight,oldwidth,oldheight){
      //wat to do with oldwidth and oldheight ?
    });

Thread Participants: 2