-Ext.define('Ext.grid.column.Column', {
- extend: 'Ext.grid.header.Container',
- alias: 'widget.gridcolumn',
- requires: ['Ext.util.KeyNav'],
- alternateClassName: 'Ext.grid.Column',
-
- baseCls: Ext.baseCSSPrefix + 'column-header ' + Ext.baseCSSPrefix + 'unselectable',
-
- // Not the standard, automatically applied overCls because we must filter out overs of child headers.
- hoverCls: Ext.baseCSSPrefix + 'column-header-over',
-
- handleWidth: 5,
-
- sortState: null,
-
- possibleSortStates: ['ASC', 'DESC'],
-
- renderTpl:
- '<div class="' + Ext.baseCSSPrefix + 'column-header-inner">' +
- '<span class="' + Ext.baseCSSPrefix + 'column-header-text">' +
- '{text}' +
- '</span>' +
- '<tpl if="!values.menuDisabled"><div class="' + Ext.baseCSSPrefix + 'column-header-trigger"></div></tpl>' +
- '</div>',
-
-<span id='Ext-grid-column-Column-cfg-columns'> /**
-</span> * @cfg {Array} columns
- * <p>An optional array of sub-column definitions. This column becomes a group, and houses the columns defined in the <code>columns</code> config.</p>
- * <p>Group columns may not be sortable. But they may be hideable and moveable. And you may move headers into and out of a group. Note that
- * if all sub columns are dragged out of a group, the group is destroyed.
- */
-
-<span id='Ext-grid-column-Column-cfg-dataIndex'> /**
-</span> * @cfg {String} dataIndex <p><b>Required</b>. The name of the field in the
- * grid's {@link Ext.data.Store}'s {@link Ext.data.Model} definition from
- * which to draw the column's value.</p>
- */
- dataIndex: null,
-
-<span id='Ext-grid-column-Column-cfg-text'> /**
-</span> * @cfg {String} text Optional. The header text to be used as innerHTML
- * (html tags are accepted) to display in the Grid. <b>Note</b>: to
- * have a clickable header with no text displayed you can use the
- * default of <tt>'&#160;'</tt>.
- */
- text: '&#160',
-
-<span id='Ext-grid-column-Column-cfg-sortable'> /**
-</span> * @cfg {Boolean} sortable Optional. <tt>true</tt> if sorting is to be allowed on this column.
- * Whether local/remote sorting is used is specified in <code>{@link Ext.data.Store#remoteSort}</code>.
- */
- sortable: true,
-
-<span id='Ext-grid-column-Column-cfg-groupable'> /**
-</span> * @cfg {Boolean} groupable Optional. If the grid uses a {@link Ext.grid.feature.Grouping}, this option
- * may be used to disable the header menu item to group by the column selected. By default,
- * the header menu group option is enabled. Set to false to disable (but still show) the
- * group option in the header menu for the column.
- */
-
-<span id='Ext-grid-column-Column-cfg-fixed'> /**
-</span> * @cfg {Boolean} fixed Prevents the column from being resizable
- */
-
-<span id='Ext-grid-column-Column-cfg-resizable'> /**
-</span> * @cfg {Boolean} resizable This config has no effect on a grid column, please see {@link #fixed} instead.
- */
-
-<span id='Ext-grid-column-Column-cfg-hideable'> /**
-</span> * @cfg {Boolean} hideable Optional. Specify as <tt>false</tt> to prevent the user from hiding this column
- * (defaults to true).
- */
- hideable: true,
-
-<span id='Ext-grid-column-Column-cfg-menuDisabled'> /**
-</span> * @cfg {Boolean} menuDisabled
- * True to disabled the column header menu containing sort/hide options. Defaults to false.
- */
- menuDisabled: false,
-
-<span id='Ext-grid-column-Column-method-renderer'> /**
-</span> * @method
- * <p>A renderer is an 'interceptor' method which can be used transform data (value, appearance, etc.) before it
- * is rendered. Example:</p>
- * <pre><code>{
- renderer: function(value){
- if (value === 1) {
- return '1 person';
- }
- return value + ' people';
- }
-}
- * </code></pre>
- * @param {Mixed} value The data value for the current cell
- * @param {Object} metaData A collection of metadata about the current cell; can be used or modified by
- * the renderer. Recognized properties are: <tt>tdCls</tt>, <tt>tdAttr</tt>, and <tt>style</tt>.
- * @param {Ext.data.Model} record The record for the current row
- * @param {Number} rowIndex The index of the current row
- * @param {Number} colIndex The index of the current column
- * @param {Ext.data.Store} store The data store
- * @param {Ext.view.View} view The current view
- * @return {String} The HTML to be rendered
- */
- renderer: false,
-
-<span id='Ext-grid-column-Column-cfg-align'> /**
-</span> * @cfg {String} align Sets the alignment of the header and rendered columns.
- * Defaults to 'left'.
- */
- align: 'left',
-
-<span id='Ext-grid-column-Column-cfg-draggable'> /**
-</span> * @cfg {Boolean} draggable Indicates whether or not the header can be drag and drop re-ordered.
- * Defaults to true.
- */
- draggable: true,
-
- // Header does not use the typical ComponentDraggable class and therefore we
- // override this with an emptyFn. It is controlled at the HeaderDragZone.
- initDraggable: Ext.emptyFn,
-
-<span id='Ext-grid-column-Column-cfg-tdCls'> /**
-</span> * @cfg {String} tdCls <p>Optional. A CSS class names to apply to the table cells for this column.</p>
- */
-
-<span id='Ext-grid-column-Column-property-triggerEl'> /**
-</span> * @property {Ext.core.Element} triggerEl
- */
-
-<span id='Ext-grid-column-Column-property-textEl'> /**
-</span> * @property {Ext.core.Element} textEl
- */
-
-<span id='Ext-grid-column-Column-property-isHeader'> /**
-</span> * @private
- * Set in this class to identify, at runtime, instances which are not instances of the
- * HeaderContainer base class, but are in fact, the subclass: Header.
- */
- isHeader: true,
-
- initComponent: function() {
- var me = this,
- i,
- len;
-
- if (Ext.isDefined(me.header)) {
- me.text = me.header;
- delete me.header;
- }
-
- // Flexed Headers need to have a minWidth defined so that they can never be squeezed out of existence by the
- // HeaderContainer's specialized Box layout, the ColumnLayout. The ColumnLayout's overridden calculateChildboxes
- // method extends the available layout space to accommodate the "desiredWidth" of all the columns.
- if (me.flex) {
- me.minWidth = me.minWidth || Ext.grid.plugin.HeaderResizer.prototype.minColWidth;
- }
- // Non-flexed Headers may never be squeezed in the event of a shortfall so
- // always set their minWidth to their current width.
- else {
- me.minWidth = me.width;
- }
-
- if (!me.triStateSort) {
- me.possibleSortStates.length = 2;
- }
-
- // A group header; It contains items which are themselves Headers
- if (Ext.isDefined(me.columns)) {
- me.isGroupHeader = true;