Is there any way to get an ExtJS GridPanel to automatically resize its width, but still be contained inside some non-ExtJS-generated HTML?

后端 未结 4 1726
说谎
说谎 2021-01-31 21:49

I want to include an ExtJS GridPanel inside a larger layout, which in turn must be rendered inside a particular div in some pre-existing HTML that I don\'t control.

4条回答
  •  难免孤独
    2021-01-31 22:08

    I don't have enough reputation to "comment anywhere" yet, but I do have a fix to the "not working when window is resized smaller" problem described by HOCA. I was having the same problem too, using the solution outlined by this answer. After Googling around for a while, I found this thread on the sencha.com website. Using a similar technique to the one described there seems to work better cross-browser (using the exact solution offered there seems to work somewhat differently between FF/IE).

    Ext.EventManager.onWindowResize(function() {
        // pass "true" to get the contendWidth (excluding border/padding/etc.)
        mainPanel.setWidth(Ext.getBody().getWidth(true));
        // seems to be no need to call mainPanel.doLayout() here in my situation
    });
    

提交回复
热议问题