View Full Version : Little help with debugging?

James Goddard
23 Jan 2012, 12:24 PM
I've got a rendering bug that I cannot duplicate with an easy test case so I'm trying to debug it.

The issue is a grid with 2 columns.

standard column with flex of 1
action column with width of 20
The column headers display correctly, but the width of the first (flex) column on all of the data rows is 0. (Actually the element is set to style="width: px".)

I've narrowed it down to when getColumnsForTpl is called for the chunker, header.getDesiredWidth () return "undefined" because width is not set:

else if (me.flex) {
return me.width;

I've looked all over the box layout trying to figure out where this should be set and can't find it for the life of me. Can one of the developers point me to where this is supposed to be set so I can figure out why it is not?

23 Jan 2012, 12:48 PM
Does your grid live within a layout or no?

James Goddard
23 Jan 2012, 12:52 PM

viewport - border - center
tab panel
panel - hbox
panel - vbox
container - flex 1 - hbox
grid - width 300

James Goddard
25 Jan 2012, 5:39 AM

26 Jan 2012, 8:27 AM
Could be the fact that you're trying to set a width lesser than the minimum for your action columns. I believe the min width value for Ext.Columns is 40, check the source for reference.

James Goddard
27 Jan 2012, 6:17 AM
I've been using 20px columns for quite a while and they work elsewhere in the same system. I also don't see anything about a min width in the doc or column source, other than being able to set one for column re-sizing.

A min width of 40 doesn't make much sense with action columns which are typically 16x16 images.

Surly someone at Sencha knows where the width of a flex column is set in the new layout stuff?

27 Jan 2012, 6:30 AM
It's just a guess but like it or not, this is from the Ext 4.1 beta 2 code:

Ext.define('Ext.grid.plugin.HeaderResizer', {
extend: 'Ext.util.Observable',
requires: ['Ext.dd.DragTracker', 'Ext.util.Region'],
alias: 'plugin.gridheaderresizer',

disabled: false,

config: {

dynamic: false

colHeaderCls: Ext.baseCSSPrefix + 'column-header',

minColWidth: 40,

James Goddard
27 Jan 2012, 6:50 AM
Ah, I see where you are getting that from.

That code is for the HeaderResizer grid plugin (which I am not using). It is the "default" minimum width to which the user can resize a column.

James Goddard
3 Feb 2012, 11:54 AM
FWIW this wound up being caused by a button in a form much further down in the layout that was anchor: 'right'. Even with an anchorSize set on the parent container this caused a layout failure in the grid columns much further up in the layout.

Pretty sure it's a bug but, I've alreay spent enough time on this so I'll leave it for the next poor programmer who finds it to report...