X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775:/docs/source/ListView.html diff --git a/docs/source/ListView.html b/docs/source/ListView.html index 5fb62bc6..3f3ba1fa 100644 --- a/docs/source/ListView.html +++ b/docs/source/ListView.html @@ -1,11 +1,17 @@ - - - The source code - - - - -
/** + + + The source code + + + + +
/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+
/** * @class Ext.ListView * @extends Ext.DataView *

Ext.ListView is a fast and light-weight implentation of a @@ -139,9 +145,10 @@ Ext.ListView = Ext.extend(Ext.DataView, { */

/** * @cfg {Number} scrollOffset The amount of space to reserve for the scrollbar (defaults to - * 19 pixels) + * undefined). If an explicit value isn't specified, this will be automatically + * calculated. */ - scrollOffset : 19, + scrollOffset : undefined,
/** * @cfg {Boolean/Object} columnResize * Specify true or specify a configuration object for {@link Ext.ListView.ColumnResizer} @@ -189,6 +196,11 @@ Ext.ListView = Ext.extend(Ext.DataView, { * The template to be used for the header row. See {@link #tpl} for more details. */ + /* + * IE has issues when setting percentage based widths to 100%. Default to 99. + */ + maxWidth: Ext.isIE ? 99 : 100, + initComponent : function(){ if(this.columnResize){ this.colResizer = new Ext.ListView.ColumnResizer(this.colResizer); @@ -226,9 +238,13 @@ Ext.ListView = Ext.extend(Ext.DataView, { '' ); }; - var cs = this.columns, allocatedWidth = 0, colsWithWidth = 0, len = cs.length; + var cs = this.columns, + allocatedWidth = 0, + colsWithWidth = 0, + len = cs.length, + columns = []; for(var i = 0; i < len; i++){ - var c = cs[i]; + var c = Ext.apply({}, cs[i]); if(!c.tpl){ c.tpl = new Ext.XTemplate('{' + c.dataIndex + '}'); }else if(Ext.isString(c.tpl)){ @@ -240,12 +256,14 @@ Ext.ListView = Ext.extend(Ext.DataView, { allocatedWidth += c.width; colsWithWidth++; } + columns.push(c); } + cs = this.columns = columns; // auto calculate missing column widths if(colsWithWidth < len){ var remaining = len - colsWithWidth; - if(allocatedWidth < 100){ - var perCol = ((100-allocatedWidth) / remaining); + if(allocatedWidth < this.maxWidth){ + var perCol = ((this.maxWidth-allocatedWidth) / remaining); for(var j = 0; j < len; j++){ var c = cs[j]; if(!Ext.isNumber(c.width)){ @@ -258,6 +276,9 @@ Ext.ListView = Ext.extend(Ext.DataView, { }, onRender : function(){ + this.autoEl = { + cls: 'x-list-wrap' + }; Ext.ListView.superclass.onRender.apply(this, arguments); this.internalTpl.overwrite(this.el, {columns: this.columns}); @@ -311,7 +332,7 @@ Ext.ListView = Ext.extend(Ext.DataView, { } var bdp = bd.parentNode; if(Ext.isNumber(w)){ - var sw = w - this.scrollOffset; + var sw = w - Ext.num(this.scrollOffset, Ext.getScrollBarWidth()); if(this.reserveScrollOffset || ((bdp.offsetWidth - bdp.clientWidth) > 10)){ bd.style.width = sw + 'px'; hd.style.width = sw + 'px'; @@ -326,7 +347,7 @@ Ext.ListView = Ext.extend(Ext.DataView, { }, 10); } } - if(Ext.isNumber(h == 'number')){ + if(Ext.isNumber(h)){ bdp.style.height = (h - hd.parentNode.offsetHeight) + 'px'; } }, @@ -355,6 +376,6 @@ Ext.ListView = Ext.extend(Ext.DataView, { } }); -Ext.reg('listview', Ext.ListView);
- +Ext.reg('listview', Ext.ListView);
+ \ No newline at end of file