X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/ColumnResizer.html diff --git a/docs/source/ColumnResizer.html b/docs/source/ColumnResizer.html index 9cb29d04..f9421691 100644 --- a/docs/source/ColumnResizer.html +++ b/docs/source/ColumnResizer.html @@ -1,32 +1,27 @@ - -
-/*! - * Ext JS Library 3.0.3 - * Copyright(c) 2006-2009 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license - */ -/** - * @class Ext.ListView.ColumnResizer + + + ++ \ No newline at end of fileThe source code + + + + +/** + * @class Ext.list.ColumnResizer * @extends Ext.util.Observable - *- +}); + +// Backwards compatibility alias +Ext.ListView.ColumnResizer = Ext.list.ColumnResizer;Supporting Class for Ext.ListView.
+ *Supporting Class for Ext.list.ListView
* @constructor * @param {Object} config */ -Ext.ListView.ColumnResizer = Ext.extend(Ext.util.Observable, { - /** +Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, { + /** * @cfg {Number} minPct The minimum percentage to allot for any column (defaults to .05) */ minPct: .05, constructor: function(config){ Ext.apply(this, config); - Ext.ListView.ColumnResizer.superclass.constructor.call(this); + Ext.list.ColumnResizer.superclass.constructor.call(this); }, init : function(listView){ this.view = listView; @@ -58,10 +53,10 @@ Ext.ListView.ColumnResizer = Ext.extend(Ext.util.Observable, { if(x - r.left <= hw && pn != pn.parentNode.firstChild){ this.activeHd = Ext.get(pn.previousSibling.firstChild); - ss.cursor = Ext.isWebKit ? 'e-resize' : 'col-resize'; + ss.cursor = Ext.isWebKit ? 'e-resize' : 'col-resize'; } else if(r.right - x <= hw && pn != pn.parentNode.lastChild.previousSibling){ this.activeHd = hd; - ss.cursor = Ext.isWebKit ? 'w-resize' : 'col-resize'; + ss.cursor = Ext.isWebKit ? 'w-resize' : 'col-resize'; } else{ delete this.activeHd; ss.cursor = ''; @@ -98,30 +93,31 @@ Ext.ListView.ColumnResizer = Ext.extend(Ext.util.Observable, { }, onEnd: function(e){ + /* calculate desired width by measuring proxy and then remove it */ var nw = this.proxy.getWidth(); this.proxy.remove(); var index = this.hdIndex, - vw = this.view, - cs = vw.columns, + vw = this.view, + cs = vw.columns, len = cs.length, - w = this.view.innerHd.getWidth(), - minPct = this.minPct * 100; + w = this.view.innerHd.getWidth(), + minPct = this.minPct * 100, pct = Math.ceil((nw * vw.maxWidth) / w), - diff = cs[index].width - pct, + diff = (cs[index].width * 100) - pct, each = Math.floor(diff / (len-1-index)), mod = diff - (each * (len-1-index)); for(var i = index+1; i < len; i++){ - var cw = cs[i].width + each, + var cw = (cs[i].width * 100) + each, ncw = Math.max(minPct, cw); if(cw != ncw){ mod += cw - ncw; } - cs[i].width = ncw; + cs[i].width = ncw / 100; } - cs[index].width = pct; - cs[index+1].width += mod; + cs[index].width = pct / 100; + cs[index+1].width += (mod / 100); delete this.dragHd; vw.setHdWidths(); vw.refresh(); @@ -129,6 +125,9 @@ Ext.ListView.ColumnResizer = Ext.extend(Ext.util.Observable, { vw.disableHeaders = false; }, 100); } -});