Results 1 to 3 of 3

Thread: How to differentiate between user resizes and automatic resizes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    May 2008
    Posts
    32
    Answers
    1

    Default Answered: How to differentiate between user resizes and automatic resizes

    When I make a component resizable, I can subscribe to the resize event of the resizer to receive only user-caused resizes. However, I need the automatic resizes too, so I subscribe to the resize event of the component as well. The problem is that when a user resizes the component, both resize events are fired. I need to be able to differentiate between these two, so ideally I wouldn't want the normal resize event when a user resizes the component (I don't get the resizer resize event when the component is automatically resized, so in that case there is no problem).

    Any ideas would be much appreciated!

    Regards,

    Caius

  2. As it happens, that doesn't do it for me, cause I want just one resize event in case of manual resize, not two. The way I did it now seems to work:

    I subscribe only to the resize event of the component, not that of the resizer
    I also subscribe to the beforeresize event of the resizer
    In the beforeresize eventhandler, I set component.inManualResize to true
    in the resize eventhandler I'm able to differentiate between manual and automatic resize

    This seems to work for me

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    I usually cheat and set a property on the class and check it in the event to differentiate.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Sencha User
    Join Date
    May 2008
    Posts
    32
    Answers
    1

    Default

    As it happens, that doesn't do it for me, cause I want just one resize event in case of manual resize, not two. The way I did it now seems to work:

    I subscribe only to the resize event of the component, not that of the resizer
    I also subscribe to the beforeresize event of the resizer
    In the beforeresize eventhandler, I set component.inManualResize to true
    in the resize eventhandler I'm able to differentiate between manual and automatic resize

    This seems to work for me

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •