Upgrade to ExtJS 3.0.3 - Released 10/11/2009
[extjs.git] / src / widgets / grid / Column.js
index 5c2d457..12d1bc5 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * Ext JS Library 3.0.0
+ * Ext JS Library 3.0.3
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
@@ -14,7 +14,7 @@
 Ext.grid.Column = function(config){\r
     Ext.apply(this, config);\r
 \r
-    if(typeof this.renderer == 'string'){\r
+    if(Ext.isString(this.renderer)){\r
         this.renderer = Ext.util.Format[this.renderer];\r
     } else if(Ext.isObject(this.renderer)){\r
         this.scope = this.renderer.scope;\r
@@ -22,16 +22,11 @@ Ext.grid.Column = function(config){
     }\r
     this.renderer = this.renderer.createDelegate(this.scope || config);\r
 \r
-    if(this.id === undefined){\r
-        this.id = ++Ext.grid.Column.AUTO_ID;\r
-    }\r
     if(this.editor){\r
         this.editor = Ext.create(this.editor, 'textfield');\r
     }\r
 };\r
 \r
-Ext.grid.Column.AUTO_ID = 0;\r
-\r
 Ext.grid.Column.prototype = {\r
     /**\r
      * @cfg {Boolean} editable Optional. Defaults to <tt>true</tt>, enabling the configured\r
@@ -116,8 +111,8 @@ Ext.grid.Column.prototype = {
      */\r
     /**\r
      * @cfg {Boolean} sortable Optional. <tt>true</tt> if sorting is to be allowed on this column.\r
-     * Defaults to the value of the {@link #defaultSortable} property.\r
-     * Whether local/remote sorting is used is specified in {@link Ext.data.Store#remoteSort}.\r
+     * Defaults to the value of the <code>{@link Ext.grid.ColumnModel#defaultSortable}</code> property.\r
+     * Whether local/remote sorting is used is specified in <code>{@link Ext.data.Store#remoteSort}</code>.\r
      */\r
     /**\r
      * @cfg {Boolean} fixed Optional. <tt>true</tt> if the column width cannot be changed.  Defaults to <tt>false</tt>.\r
@@ -129,7 +124,10 @@ Ext.grid.Column.prototype = {
      * @cfg {Boolean} menuDisabled Optional. <tt>true</tt> to disable the column menu. Defaults to <tt>false</tt>.\r
      */\r
     /**\r
-     * @cfg {Boolean} hidden Optional. <tt>true</tt> to hide the column. Defaults to <tt>false</tt>.\r
+     * @cfg {Boolean} hidden\r
+     * Optional. <tt>true</tt> to initially hide this column. Defaults to <tt>false</tt>.\r
+     * A hidden column {@link Ext.grid.GridPanel#enableColumnHide may be shown via the header row menu}.\r
+     * If a column is never to be shown, simply do not include this column in the Column Model at all. \r
      */\r
     /**\r
      * @cfg {String} tooltip Optional. A text string to use as the column header's tooltip.  If Quicktips\r
@@ -226,8 +224,15 @@ var grid = new Ext.grid.GridPanel({
      * if editing is supported by the grid. See <tt>{@link #editable}</tt> also.\r
      */\r
 \r
-    // private. Used by ColumnModel to avoid reprocessing\r
+    /**\r
+     * @private\r
+     * @cfg {Boolean} isColumn\r
+     * Used by ColumnModel setConfig method to avoid reprocessing a Column\r
+     * if <code>isColumn</code> is not set ColumnModel will recreate a new Ext.grid.Column\r
+     * Defaults to true.\r
+     */\r
     isColumn : true,\r
+\r
     /**\r
      * Optional. A function which returns displayable data when passed the following parameters:\r
      * <div class="mdetail-params"><ul>\r
@@ -247,7 +252,7 @@ var grid = new Ext.grid.GridPanel({
      * @type Function\r
      */\r
     renderer : function(value){\r
-        if(typeof value == 'string' && value.length < 1){\r
+        if(Ext.isString(value) && value.length < 1){\r
             return '&#160;';\r
         }\r
         return value;\r
@@ -283,8 +288,8 @@ var grid = new Ext.grid.GridPanel({
 /**\r
  * @class Ext.grid.BooleanColumn\r
  * @extends Ext.grid.Column\r
- * <p>A Column definition class which renders boolean data fields.  See the {@link Ext.grid.ColumnModel#xtype xtype}\r
- * config option of {@link Ext.grid.ColumnModel} for more details.</p>\r
+ * <p>A Column definition class which renders boolean data fields.  See the {@link Ext.grid.Column#xtype xtype}\r
+ * config option of {@link Ext.grid.Column} for more details.</p>\r
  */\r
 Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, {\r
     /**\r
@@ -323,7 +328,7 @@ Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, {
  * @class Ext.grid.NumberColumn\r
  * @extends Ext.grid.Column\r
  * <p>A Column definition class which renders a numeric data field according to a {@link #format} string.  See the\r
- * {@link Ext.grid.ColumnModel#xtype xtype} config option of {@link Ext.grid.ColumnModel} for more details.</p>\r
+ * {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more details.</p>\r
  */\r
 Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, {\r
     /**\r
@@ -342,7 +347,7 @@ Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, {
  * @class Ext.grid.DateColumn\r
  * @extends Ext.grid.Column\r
  * <p>A Column definition class which renders a passed date according to the default locale, or a configured\r
- * {@link #format}. See the {@link Ext.grid.ColumnModel#xtype xtype} config option of {@link Ext.grid.ColumnModel}\r
+ * {@link #format}. See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column}\r
  * for more details.</p>\r
  */\r
 Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, {\r
@@ -363,7 +368,7 @@ Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, {
  * @extends Ext.grid.Column\r
  * <p>A Column definition class which renders a value by processing a {@link Ext.data.Record Record}'s\r
  * {@link Ext.data.Record#data data} using a {@link #tpl configured} {@link Ext.XTemplate XTemplate}.\r
- * See the {@link Ext.grid.ColumnModel#xtype xtype} config option of {@link Ext.grid.ColumnModel} for more\r
+ * See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more\r
  * details.</p>\r
  */\r
 Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, {\r
@@ -374,7 +379,7 @@ Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, {
      */\r
     constructor: function(cfg){\r
         Ext.grid.TemplateColumn.superclass.constructor.call(this, cfg);\r
-        var tpl = typeof Ext.isObject(this.tpl) ? this.tpl : new Ext.XTemplate(this.tpl);\r
+        var tpl = Ext.isObject(this.tpl) ? this.tpl : new Ext.XTemplate(this.tpl);\r
         this.renderer = function(value, p, r){\r
             return tpl.apply(r.data);\r
         };\r