View Full Version : Strange behaviour with GridPanel vertical scroll bar

19 Oct 2010, 8:38 AM

I have some code that essentially is a tabPanel with two containers that have form layout. In one container I have a number of items, one of which is a GridPanel.

The strange thing is that when the grid panel is displayed (only 3 items in the grid list) it adds a final empty column, which as far as I can tell is where the vertical scroll bar goes (but in this case no scroll bar is required). My grid model is:

Volumes.Grid = Ext.extend(Ext.grid.GridPanel, {
initComponent:function() {
var config = {
sm : checkboxSel,
columnLines : true,
border : false,
store : vdevStore,
autoHeight : false,
autoScroll : true,
autoExpandColumn : 'disca-col',
loadMask : true,
deferredRender : false,
viewConfig : { autoFill : true, forceFit : true },
columns : [
header : "Device",
id : 'disca-col',
sortable : true,
hideable : false,
dataIndex : 'disca'

Ext.apply(this, Ext.apply(this.initialConfig, config));
Volumes.Grid.superclass.initComponent.apply(this, arguments);
} // eo function initComponent

Ext.reg('volgrid', Volumes.Grid);So the autoFill and forceFit are set correctly, the containers put into the tabPanel are of layout form, the tabPanel and two other components then make up part of a final, outer tabPanel which is then rendered. So, all looks fine, except that whenever data is loaded into the grid (initially it is empty - no scroll column), it adds the, unnecessary, vertical scroll column.

It must be me, probably over nesting somewhere, but I cannot for the life of me get it to behave as expected. Anyone any ideas I can try to get rid of the unnecessary empty column when scrolling is not required?

19 Oct 2010, 8:45 AM
If I understand you correctly then in my experience its typical behaviour to see that little bit of "extra' column as its been called. I know there has been some similar postings on the forum here asking about it and how to remove it.

19 Oct 2010, 8:50 AM
Yes, I've seen references to "scrollOffset : 0" to remove scroll, but that removes it completely - and it does work as expected if I remove some of the containers (i.e. tabPanel's) - so that is why I think it is my code - perhaps form layout needs to know the number of elements in the grid and I am not providing this so it just adds the scroll bar "just in case it's needed".

But your right - I've seen lots of references to this "extra space" - but nobody seems to come up with an explanation - if I could just work out why it puts the space there when not required...