-<html>
-<head>
- <title>The source code</title>
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
-</head>
-<body onload="prettyPrint();">
- <pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-<div id="cls-Ext.ListView.ColumnResizer"></div>/**\r
- * @class Ext.ListView.ColumnResizer\r
+<html>\r
+<head>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \r
+ <title>The source code</title>\r
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body onload="prettyPrint();">\r
+ <pre class="prettyprint lang-js"><div id="cls-Ext.list.ColumnResizer"></div>/**\r
+ * @class Ext.list.ColumnResizer\r
* @extends Ext.util.Observable\r
- * <p>Supporting Class for Ext.ListView.</p>\r
+ * <p>Supporting Class for Ext.list.ListView</p>\r
* @constructor\r
* @param {Object} config\r
*/\r
-Ext.ListView.ColumnResizer = Ext.extend(Ext.util.Observable, {\r
- <div id="cfg-Ext.ListView.ColumnResizer-minPct"></div>/**\r
+Ext.list.ColumnResizer = Ext.extend(Ext.util.Observable, {\r
+ <div id="cfg-Ext.list.ColumnResizer-minPct"></div>/**\r
* @cfg {Number} minPct The minimum percentage to allot for any column (defaults to <tt>.05</tt>)\r
*/\r
minPct: .05,\r
\r
constructor: function(config){\r
Ext.apply(this, config);\r
- Ext.ListView.ColumnResizer.superclass.constructor.call(this);\r
+ Ext.list.ColumnResizer.superclass.constructor.call(this);\r
},\r
init : function(listView){\r
this.view = listView;\r
\r
if(x - r.left <= hw && pn != pn.parentNode.firstChild){\r
this.activeHd = Ext.get(pn.previousSibling.firstChild);\r
- ss.cursor = Ext.isWebKit ? 'e-resize' : 'col-resize';\r
+ ss.cursor = Ext.isWebKit ? 'e-resize' : 'col-resize';\r
} else if(r.right - x <= hw && pn != pn.parentNode.lastChild.previousSibling){\r
this.activeHd = hd;\r
- ss.cursor = Ext.isWebKit ? 'w-resize' : 'col-resize';\r
+ ss.cursor = Ext.isWebKit ? 'w-resize' : 'col-resize';\r
} else{\r
delete this.activeHd;\r
ss.cursor = '';\r
},\r
\r
onEnd: function(e){\r
+ /* calculate desired width by measuring proxy and then remove it */\r
var nw = this.proxy.getWidth();\r
this.proxy.remove();\r
\r
var index = this.hdIndex,\r
- vw = this.view, \r
- cs = vw.columns, \r
+ vw = this.view,\r
+ cs = vw.columns,\r
len = cs.length,\r
- w = this.view.innerHd.getWidth(), \r
- minPct = this.minPct * 100;\r
+ w = this.view.innerHd.getWidth(),\r
+ minPct = this.minPct * 100,\r
pct = Math.ceil((nw * vw.maxWidth) / w),\r
- diff = cs[index].width - pct,\r
+ diff = (cs[index].width * 100) - pct,\r
each = Math.floor(diff / (len-1-index)),\r
mod = diff - (each * (len-1-index));\r
\r
for(var i = index+1; i < len; i++){\r
- var cw = cs[i].width + each,\r
+ var cw = (cs[i].width * 100) + each,\r
ncw = Math.max(minPct, cw);\r
if(cw != ncw){\r
mod += cw - ncw;\r
}\r
- cs[i].width = ncw;\r
+ cs[i].width = ncw / 100;\r
}\r
- cs[index].width = pct;\r
- cs[index+1].width += mod;\r
+ cs[index].width = pct / 100;\r
+ cs[index+1].width += (mod / 100);\r
delete this.dragHd;\r
vw.setHdWidths();\r
vw.refresh();\r
vw.disableHeaders = false;\r
}, 100);\r
}\r
-});</pre>
-</body>
+});\r
+\r
+// Backwards compatibility alias\r
+Ext.ListView.ColumnResizer = Ext.list.ColumnResizer;</pre> \r
+</body>\r
</html>
\ No newline at end of file