X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..92c2b89db26be16707f4a805d3303ab2531006e1:/docs/source/Column.html?ds=sidebyside diff --git a/docs/source/Column.html b/docs/source/Column.html index 4c2c4c43..0bab9bf1 100644 --- a/docs/source/Column.html +++ b/docs/source/Column.html @@ -1,5 +1,6 @@
+While subclasses are provided to render data in different ways, this class renders a passed * data field unchanged and is usually used for textual columns.
*/ -Ext.grid.Column = function(config){ - Ext.apply(this, config); - - if(typeof this.renderer == 'string'){ - this.renderer = Ext.util.Format[this.renderer]; - } else if(Ext.isObject(this.renderer)){ - this.scope = this.renderer.scope; - this.renderer = this.renderer.fn; - } - this.renderer = this.renderer.createDelegate(this.scope || config); - - if(this.id === undefined){ - this.id = ++Ext.grid.Column.AUTO_ID; - } - if(this.editor){ - this.editor = Ext.create(this.editor, 'textfield'); - } -}; - -Ext.grid.Column.AUTO_ID = 0; - -Ext.grid.Column.prototype = { +Ext.grid.Column = Ext.extend(Object, { /** * @cfg {Boolean} editable Optional. Defaults to true, enabling the configured * {@link #editor}. Set to false to initially disable editing on this column. @@ -117,8 +97,8 @@ Ext.grid.Column.prototype = { */ /** * @cfg {Boolean} sortable Optional. true if sorting is to be allowed on this column. - * Defaults to the value of the {@link #defaultSortable} property. - * Whether local/remote sorting is used is specified in {@link Ext.data.Store#remoteSort}. + * Defaults to the value of the{@link Ext.grid.ColumnModel#defaultSortable}
property.
+ * Whether local/remote sorting is used is specified in {@link Ext.data.Store#remoteSort}
.
*/
/**
* @cfg {Boolean} fixed Optional. true if the column width cannot be changed. Defaults to false.
@@ -130,7 +110,10 @@ Ext.grid.Column.prototype = {
* @cfg {Boolean} menuDisabled Optional. true to disable the column menu. Defaults to false.
*/
/**
- * @cfg {Boolean} hidden Optional. true to hide the column. Defaults to false.
+ * @cfg {Boolean} hidden
+ * Optional. true to initially hide this column. Defaults to false.
+ * A hidden column {@link Ext.grid.GridPanel#enableColumnHide may be shown via the header row menu}.
+ * If a column is never to be shown, simply do not include this column in the Column Model at all.
*/
/**
* @cfg {String} tooltip Optional. A text string to use as the column header's tooltip. If Quicktips
@@ -227,8 +210,33 @@ var grid = new Ext.grid.GridPanel({
* if editing is supported by the grid. See {@link #editable} also.
*/
- // private. Used by ColumnModel to avoid reprocessing
+ /**
+ * @private
+ * @cfg {Boolean} isColumn
+ * Used by ColumnModel setConfig method to avoid reprocessing a Column
+ * if isColumn
is not set ColumnModel will recreate a new Ext.grid.Column
+ * Defaults to true.
+ */
isColumn : true,
+
+ constructor : function(config){
+ Ext.apply(this, config);
+
+ if(Ext.isString(this.renderer)){
+ this.renderer = Ext.util.Format[this.renderer];
+ }else if(Ext.isObject(this.renderer)){
+ this.scope = this.renderer.scope;
+ this.renderer = this.renderer.fn;
+ }
+ if(!this.scope){
+ this.scope = this;
+ }
+
+ var ed = this.editor;
+ delete this.editor;
+ this.setEditor(ed);
+ },
+
/**
* Optional. A function which returns displayable data when passed the following parameters:
* A Column definition class which renders boolean data fields. See the {@link Ext.grid.ColumnModel#xtype xtype} - * config option of {@link Ext.grid.ColumnModel} for more details.
+ *A Column definition class which renders boolean data fields. See the {@link Ext.grid.Column#xtype xtype} + * config option of {@link Ext.grid.Column} for more details.
*/ Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, { /** @@ -324,7 +347,7 @@ Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, { * @class Ext.grid.NumberColumn * @extends Ext.grid.Column *A Column definition class which renders a numeric data field according to a {@link #format} string. See the - * {@link Ext.grid.ColumnModel#xtype xtype} config option of {@link Ext.grid.ColumnModel} for more details.
+ * {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more details. */ Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, { /** @@ -343,7 +366,7 @@ Ext.grid.NumberColumn = Ext.extend(Ext.grid.Column, { * @class Ext.grid.DateColumn * @extends Ext.grid.Column *A Column definition class which renders a passed date according to the default locale, or a configured - * {@link #format}. See the {@link Ext.grid.ColumnModel#xtype xtype} config option of {@link Ext.grid.ColumnModel} + * {@link #format}. See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} * for more details.
*/ Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, { @@ -364,7 +387,7 @@ Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, { * @extends Ext.grid.Column *A Column definition class which renders a value by processing a {@link Ext.data.Record Record}'s * {@link Ext.data.Record#data data} using a {@link #tpl configured} {@link Ext.XTemplate XTemplate}. - * See the {@link Ext.grid.ColumnModel#xtype xtype} config option of {@link Ext.grid.ColumnModel} for more + * See the {@link Ext.grid.Column#xtype xtype} config option of {@link Ext.grid.Column} for more * details.
*/ Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, { @@ -375,7 +398,7 @@ Ext.grid.TemplateColumn = Ext.extend(Ext.grid.Column, { */ constructor: function(cfg){ Ext.grid.TemplateColumn.superclass.constructor.call(this, cfg); - var tpl = typeof Ext.isObject(this.tpl) ? this.tpl : new Ext.XTemplate(this.tpl); + var tpl = (!Ext.isPrimitive(this.tpl) && this.tpl.compile) ? this.tpl : new Ext.XTemplate(this.tpl); this.renderer = function(value, p, r){ return tpl.apply(r.data); };