X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/src/widgets/layout/ColumnLayout.js diff --git a/src/widgets/layout/ColumnLayout.js b/src/widgets/layout/ColumnLayout.js index 0dd3be93..314125ba 100644 --- a/src/widgets/layout/ColumnLayout.js +++ b/src/widgets/layout/ColumnLayout.js @@ -1,6 +1,6 @@ /*! - * Ext JS Library 3.1.0 - * Copyright(c) 2006-2009 Ext JS, LLC + * Ext JS Library 3.1.1 + * Copyright(c) 2006-2010 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license */ @@ -66,6 +66,8 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { // private monitorResize:true, + type: 'column', + extraCls: 'x-column', scrollOffset : 0, @@ -75,22 +77,36 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { targetCls: 'x-column-layout-ct', isValidParent : function(c, target){ - return c.getPositionEl().dom.parentNode == this.innerCt.dom; + return this.innerCt && c.getPositionEl().dom.parentNode == this.innerCt.dom; }, - // private - onLayout : function(ct, target){ - var cs = ct.items.items, len = cs.length, c, i; + getLayoutTargetSize : function() { + var target = this.container.getLayoutTarget(), ret; + if (target) { + ret = target.getViewSize(); + ret.width -= target.getPadding('lr'); + ret.height -= target.getPadding('tb'); + } + return ret; + }, + renderAll : function(ct, target) { if(!this.innerCt){ // the innerCt prevents wrapping and shuffling while // the container is resizing this.innerCt = target.createChild({cls:'x-column-inner'}); this.innerCt.createChild({cls:'x-clear'}); } - this.renderAll(ct, this.innerCt); + Ext.layout.ColumnLayout.superclass.renderAll.call(this, ct, this.innerCt); + }, - var size = target.getViewSize(true); + // private + onLayout : function(ct, target){ + var cs = ct.items.items, len = cs.length, c, i; + + this.renderAll(ct, target); + + var size = this.getLayoutTargetSize(); if(size.width < 1 && size.height < 1){ // display none? return; @@ -108,7 +124,7 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { for(i = 0; i < len; i++){ c = cs[i]; if(!c.columnWidth){ - pw -= (c.getSize().width + c.getPositionEl().getMargins('lr')); + pw -= (c.getWidth() + c.getPositionEl().getMargins('lr')); } } @@ -120,6 +136,19 @@ Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, { c.setSize(Math.floor(c.columnWidth * pw) - c.getPositionEl().getMargins('lr')); } } + + // Browsers differ as to when they account for scrollbars. We need to re-measure to see if the scrollbar + // spaces were accounted for properly. If not, re-layout. + if (Ext.isIE) { + if (i = target.getStyle('overflow') && i != 'hidden' && !this.adjustmentPass) { + var ts = this.getLayoutTargetSize(); + if (ts.width != size.width){ + this.adjustmentPass = true; + this.onLayout(ct, target); + } + } + } + delete this.adjustmentPass; } /**