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 1764
说谎
说谎 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:20

    I solved it by setting the layout: 'fit' to the panel that contains the grid

    var myGridTab = new Ext.Panel({
        layout: 'border',
        region: 'center',
        autoScroll: true,
        animCollapse: false,
        forceFit: true,
        title: ' My Grid Tab ',
        split: true,
        border: false,
        items: [
        {
            region: 'center',
            **layout: 'fit',**
            autoScroll: true,
            items: [myGrid],
            height: 150,
            forceFit: true
        }]
    });
    

提交回复
热议问题