PDA

View Full Version : [3.3.x] [FIXED-1173] grid column width problem on webkit browsers



maksimenko
2 Aug 2010, 1:01 PM
Hello there,

Since the grid refactoring, all the columns in a grid (with forceFit: true, inside a layout: border, region: center) are rendered with the same width on webkit browsers (tested on chrome 5.0.375.125 & chromium 6.0.483.0 - 54509)

The problem is a missing + "px" on the Ext.isNumber & if (Ext.isBorderBox || (Ext.isWebKit && !Ext.isSafari2)) case...



Ext.override(Ext.grid.GridView, {
getColumnWidth: function (column) {
var columnWidth = this.cm.getColumnWidth(column),
borderWidth = this.borderWidth;

if (Ext.isNumber(columnWidth)) {
if (Ext.isBorderBox || (Ext.isWebKit && !Ext.isSafari2)) {
return columnWidth + "px";
} else {
return Math.max(columnWidth - borderWidth, 0) + "px";
}
} else {
return columnWidth;
}
}
});


With that it renders as expected on webkit browsers (tested also on ie non-strict, quirks mode)

Let me know if you need more info.

Thanks

Jamie Avins
3 Aug 2010, 9:22 AM
[type]: fix
[module]: GridView
[id]: #1173
[desc]: Fixes #1173. getColumn witdth should always append 'px' to numeric values before returning.