/** * @class Ext.grid.Column *

This class encapsulates column configuration data to be used in the initialization of a * {@link Ext.grid.ColumnModel ColumnModel}.

*

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(typeof this.renderer == 'object'){ this.scope = this.renderer.scope; this.renderer = this.renderer.fn; } this.renderer = this.renderer.createDelegate(this.scope || config); if(typeof this.id == "undefined"){ this.id = ++Ext.grid.Column.AUTO_ID; } if(this.editor){ if(this.editor.xtype && !this.editor.events){ this.editor = Ext.create(this.editor, 'textfield'); } } } Ext.grid.Column.AUTO_ID = 0; Ext.grid.Column.prototype = {
/** * @cfg {Boolean} editable (optional) Defaults to true, enabling the configured * {@link #editor}. Set to false to initially disable editing on this column. * The initial configuration may be dynamically altered using * {@link Ext.grid.ColumnModel}.{@link Ext.grid.ColumnModel#setEditable setEditable()}. */
/** * @cfg {String} id (optional) A name which identifies this column (defaults to the column's initial * ordinal position.) The id is used to create a CSS class name which is applied to all * table cells (including headers) in that column (in this context the id does not need to be * unique). The class name takes the form of
x-grid3-td-id
* Header cells will also receive this class name, but will also have the class
x-grid3-hd
* So, to target header cells, use CSS selectors such as:
.x-grid3-hd.x-grid3-td-id
* The {@link Ext.grid.GridPanel#autoExpandColumn} grid config option references the column via this * unique identifier. */
/** * @cfg {String} header The header text to be used as innerHTML (html tags are accepted) * to display in the Grid view. */
/** * @cfg {Boolean} groupable If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option * may be used to disable the header menu item to group by the column selected. Defaults to true, * which enables the header menu group option. Set to false to disable (but still show) the * group option in the header menu for the column. See also {@link #groupName}. */
/** * @cfg {String} groupName If the grid is being rendered by an {@link Ext.grid.GroupingView}, this option * may be used to specify the text with which to prefix the group field value in the group header line. * See also {@link #groupRenderer} and * {@link Ext.grid.GroupingView}.{@link Ext.grid.GroupingView#showGroupName showGroupName}. */
/** * @cfg {String} dataIndex (optional) The name of the field in the grid's {@link Ext.data.Store}'s * {@link Ext.data.Record} definition from which to draw the column's value. If not * specified, the column's index is used as an index into the Record's data Array. */
/** * @cfg {Number} width * (optional) The initial width in pixels of the column. * The width of each column can also be affected if any of the following are configured: *