-<html>\r
-<head>\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.ListView"></div>/**\r
+<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"></div>/**\r
* @class Ext.ListView\r
* @extends Ext.DataView\r
* <p>Ext.ListView is a fast and light-weight implentation of a\r
*/\r
<div id="cfg-Ext.ListView-scrollOffset"></div>/**\r
* @cfg {Number} scrollOffset The amount of space to reserve for the scrollbar (defaults to\r
- * <tt>19</tt> pixels)\r
+ * <tt>undefined</tt>). If an explicit value isn't specified, this will be automatically\r
+ * calculated.\r
*/\r
- scrollOffset : 19,\r
+ scrollOffset : undefined,\r
<div id="cfg-Ext.ListView-columnResize"></div>/**\r
* @cfg {Boolean/Object} columnResize\r
* Specify <tt>true</tt> or specify a configuration object for {@link Ext.ListView.ColumnResizer}\r
* The template to be used for the header row. See {@link #tpl} for more details.\r
*/\r
\r
+ /*\r
+ * IE has issues when setting percentage based widths to 100%. Default to 99.\r
+ */\r
+ maxWidth: Ext.isIE ? 99 : 100,\r
+ \r
initComponent : function(){\r
if(this.columnResize){\r
this.colResizer = new Ext.ListView.ColumnResizer(this.colResizer);\r
'</tpl>'\r
);\r
};\r
- var cs = this.columns, allocatedWidth = 0, colsWithWidth = 0, len = cs.length;\r
+ var cs = this.columns, \r
+ allocatedWidth = 0, \r
+ colsWithWidth = 0, \r
+ len = cs.length, \r
+ columns = [];\r
for(var i = 0; i < len; i++){\r
- var c = cs[i];\r
+ var c = Ext.apply({}, cs[i]);\r
if(!c.tpl){\r
c.tpl = new Ext.XTemplate('{' + c.dataIndex + '}');\r
}else if(Ext.isString(c.tpl)){\r
allocatedWidth += c.width;\r
colsWithWidth++;\r
}\r
+ columns.push(c);\r
}\r
+ cs = this.columns = columns;\r
// auto calculate missing column widths\r
if(colsWithWidth < len){\r
var remaining = len - colsWithWidth;\r
- if(allocatedWidth < 100){\r
- var perCol = ((100-allocatedWidth) / remaining);\r
+ if(allocatedWidth < this.maxWidth){\r
+ var perCol = ((this.maxWidth-allocatedWidth) / remaining);\r
for(var j = 0; j < len; j++){\r
var c = cs[j];\r
if(!Ext.isNumber(c.width)){\r
},\r
\r
onRender : function(){\r
+ this.autoEl = {\r
+ cls: 'x-list-wrap' \r
+ };\r
Ext.ListView.superclass.onRender.apply(this, arguments);\r
\r
this.internalTpl.overwrite(this.el, {columns: this.columns});\r
}\r
var bdp = bd.parentNode;\r
if(Ext.isNumber(w)){\r
- var sw = w - this.scrollOffset;\r
+ var sw = w - Ext.num(this.scrollOffset, Ext.getScrollBarWidth());\r
if(this.reserveScrollOffset || ((bdp.offsetWidth - bdp.clientWidth) > 10)){\r
bd.style.width = sw + 'px';\r
hd.style.width = sw + 'px';\r
}, 10);\r
}\r
}\r
- if(Ext.isNumber(h == 'number')){\r
+ if(Ext.isNumber(h)){\r
bdp.style.height = (h - hd.parentNode.offsetHeight) + 'px';\r
}\r
},\r
}\r
});\r
\r
-Ext.reg('listview', Ext.ListView);</pre> \r
-</body>\r
+Ext.reg('listview', Ext.ListView);</pre>
+</body>
</html>
\ No newline at end of file