We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44195
    • 293 Posts
    I have a rather large form I want to put in a modal window in my CMP. I've set it to be 97% width of the browser viewport and works fine unless the user resizes their browser.
    I can't seem to work out how to have the window adapt to the new browser size.
    At the moment I have something along the lines of the following on my grid:

    ,listeners: {
        'resize': function() {
            MyComponent.window.MyWindow.doLayout();
        }
    }
    


    So as I understand it, this is listening for a resize event on my grid.
    Any hints as to what I'm missing? smiley
      I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
      Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
      • 8274 ☆ A M B ☆
      • 222 Posts
      Is this attached to your modal window instance, or a separate window instance (in other words, if I am not mistaken, if this is attached to anything BUT a window instance, then it is listening for a resize of that element).

      I saw this on SO that may be of some help:

      http://stackoverflow.com/questions/9994221/how-i-get-width-and-heigt-of-window-on-listeners-extjs-4

      With only the little bit of code, it is hard to tell what is going on, though