Results 1 to 2 of 2

Thread: How to revert to automatic layout after manual resize via resize handles?

  1. #1
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    51

    Default How to revert to automatic layout after manual resize via resize handles?

    I have the following UI:
    window
    layout 'fit'
    resizable: { handles: 'e w' }
    form
    layout { type: 'vbox', align: 'stretch' }
    container { ... }
    htmleditor { ... }


    My application logic calls setWidth dynamically on the htmleditor, and expects that the window will resize to accommodate the new width. This works as expected... up until the first time I use the window's resize handles to change the width. After that, calls to setWidth on the htmleditor have no visible effect. I want to allow the user to change the width manually, but at a point determined by the application logic, I want to reassert programmatic control over the width and have the owner containers recalculated automatically as they were before the first resize.


    How can I accomplish this? I'm thinking it's got something to do with the "width models" being altered by the manual size, but I haven't found much in the documentation...

    --UPDATE--
    Not sure whether this is the best solution, but I've discovered I can get the window to revert to automatic sizing by forcing its width/height properties to undefined. I tried this after observing that the existence of numeric values in a width/height property caused getSizeModel to choose a "configured" sizeModel for the corresponding dimension (rather than the desired "calculatedFromShrinkWrap").

    Thanks,
    Brett Stahlman

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    Hi,

    Your solution looks right. The way the resize handles and shrinkwrap work are a bit at odds with one another.

Posting Permissions

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