Note that there are some explanatory texts on larger screens.

plurals
  1. POextj4 grid doesn't fit in container panel
    text
    copied!<p>I have a grid with data, contained in a panel which also hold a title and a smaller summary grid. the panel has layout fit and therefore the title and first grid, which is the summary grid, are displayed just fine. But the grid in question has more records than can be shown on the screen and its component height is not adjusted to the size of the panel which always fits with the height of the browser window. </p> <p>What I would like to have is that the grid component's height, like the panel, is adjusted to its parent so that the scrollbar inside the grid body will show up.</p> <p>My code is similar to this (initComponent is of an extension to Ext.panel.Panel): (header in this code means the summary grid)</p> <pre><code>initComponent: function (config) { var config = { border: false, hidden: false, hideMode: "display", padding: '5', layout: "fit" } Ext.apply(this, Ext.apply(this.initialConfig, config)); this.callParent(arguments); title = Ext.create("Ext.panel.Panel", { html: '&lt;h2&gt;title&lt;/h2&gt;', padding: '5', border: false }); // the stores for the grids are created here var storeHdr = DataStoreFactory.CreateStore("GetHeaderP", DataStoreFactory.fieldsCollection.Default); var storeBdy = DataStoreFactory.CreateStore("GetBodyP", DataStoreFactory.fieldsCollection.Default); var grdHeader = Ext.create("Ext.grid.Panel", { store: storeHdr, columns: getHeaderColumns(), columnLines: true, autoHeight: false, autoWidth: false, enableHdMenu: false, enableColumnMove: false, enableColumnResize: false, disableSelection: true, trackMouseOver: false, sortable: false }); var grdBody = Ext.create("Ext.grid.Panel", { id: id, store: storeBdy, columns: getBodyColumns(), columnLines: true, autoHeight: false, autoWidth: false, autoScroll: true, scroll: "vertical", enableColumnMove: false, enableColumnResize: false, enableHdMenu: false, trackMouseOver: false, disableSelection: true }); }, var headerGridContainer = Ext.create("Ext.panel.Panel", { layout: "fit", border: false, items: [grdHeader] }); var bodyGridContainer = Ext.create("Ext.panel.Panel", { layout: "fit", border: false, items: [grdBody] }); this.add(title); this.add(headerGridContainer); this.add(bodyGridContainer); storeHdr.load(); storeBdy.load(); this.doLayout(); } </code></pre> <p>I hope someone can help me with this. Thanks in advance</p> <p>edit - screenshots how it is and how it should be. Realtime Data is removed or blotted out, since it is private and doesn't matter for the problem.</p> <p><img src="https://i.stack.imgur.com/ni1RW.png" alt="how it is"> this is how it is</p> <p><img src="https://i.stack.imgur.com/rVAwY.png" alt="how it should be"> this is how it should be</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload