-<span id='Ext-grid-header-Container-cfg-weight'> /**
-</span> * @cfg {Number} weight
- * HeaderContainer overrides the default weight of 0 for all docked items to 100.
- * This is so that it has more priority over things like toolbars.
- */
- weight: 100,
- defaultType: 'gridcolumn',
-<span id='Ext-grid-header-Container-cfg-defaultWidth'> /**
-</span> * @cfg {Number} defaultWidth
- * Width of the header if no width or flex is specified. Defaults to 100.
- */
- defaultWidth: 100,
-
-
- sortAscText: 'Sort Ascending',
- sortDescText: 'Sort Descending',
- sortClearText: 'Clear Sort',
- columnsText: 'Columns',
-
- lastHeaderCls: Ext.baseCSSPrefix + 'column-header-last',
- firstHeaderCls: Ext.baseCSSPrefix + 'column-header-first',
- headerOpenCls: Ext.baseCSSPrefix + 'column-header-open',
-
- // private; will probably be removed by 4.0
- triStateSort: false,
-
- ddLock: false,
-
- dragging: false,
-
-<span id='Ext-grid-header-Container-property-isGroupHeader'> /**
-</span> * <code>true</code> if this HeaderContainer is in fact a group header which contains sub headers.
- * @type Boolean
- * @property isGroupHeader
- */
-
-<span id='Ext-grid-header-Container-cfg-sortable'> /**
-</span> * @cfg {Boolean} sortable
- * Provides the default sortable state for all Headers within this HeaderContainer.
- * Also turns on or off the menus in the HeaderContainer. Note that the menu is
- * shared across every header and therefore turning it off will remove the menu
- * items for every header.
- */
- sortable: true,
-
- initComponent: function() {
- var me = this;
-
- me.headerCounter = 0;
- me.plugins = me.plugins || [];
-
- // TODO: Pass in configurations to turn on/off dynamic
- // resizing and disable resizing all together
-
- // Only set up a Resizer and Reorderer for the topmost HeaderContainer.
- // Nested Group Headers are themselves HeaderContainers
- if (!me.isHeader) {
- me.resizer = Ext.create('Ext.grid.plugin.HeaderResizer');
- me.reorderer = Ext.create('Ext.grid.plugin.HeaderReorderer');
- if (!me.enableColumnResize) {
- me.resizer.disable();
- }
- if (!me.enableColumnMove) {
- me.reorderer.disable();
- }
- me.plugins.push(me.reorderer, me.resizer);
- }
-
- // Base headers do not need a box layout
- if (me.isHeader && !me.items) {
- me.layout = 'auto';
- }
- // HeaderContainer and Group header needs a gridcolumn layout.
- else {
- me.layout = {
- type: 'gridcolumn',
- availableSpaceOffset: me.availableSpaceOffset,
- align: 'stretchmax',
- resetStretch: true
- };
- }
- me.defaults = me.defaults || {};
- Ext.applyIf(me.defaults, {
- width: me.defaultWidth,
- triStateSort: me.triStateSort,
- sortable: me.sortable
- });
- me.callParent();
- me.addEvents(
-<span id='Ext-grid-header-Container-event-columnresize'> /**
-</span> * @event columnresize
- * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
- * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
- * @param {Number} width
- */
- 'columnresize',
-
-<span id='Ext-grid-header-Container-event-headerclick'> /**
-</span> * @event headerclick
- * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
- * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
- * @param {Ext.EventObject} e
- * @param {HTMLElement} t
- */
- 'headerclick',
-
-<span id='Ext-grid-header-Container-event-headertriggerclick'> /**
-</span> * @event headertriggerclick
- * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
- * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
- * @param {Ext.EventObject} e
- * @param {HTMLElement} t
- */
- 'headertriggerclick',
-
-<span id='Ext-grid-header-Container-event-columnmove'> /**
-</span> * @event columnmove
- * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
- * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
- * @param {Number} fromIdx
- * @param {Number} toIdx
- */
- 'columnmove',
-<span id='Ext-grid-header-Container-event-columnhide'> /**
-</span> * @event columnhide
- * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
- * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
- */
- 'columnhide',
-<span id='Ext-grid-header-Container-event-columnshow'> /**
-</span> * @event columnshow
- * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
- * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
- */
- 'columnshow',
-<span id='Ext-grid-header-Container-event-sortchange'> /**
-</span> * @event sortchange
- * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
- * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
- * @param {String} direction
- */
- 'sortchange',
-<span id='Ext-grid-header-Container-event-menucreate'> /**
-</span> * @event menucreate
- * Fired immediately after the column header menu is created.
- * @param {Ext.grid.header.Container} ct This instance
- * @param {Ext.menu.Menu} menu The Menu that was created
- */
- 'menucreate'
- );
- },
-
- onDestroy: function() {
- Ext.destroy(this.resizer, this.reorderer);
- this.callParent();
- },
-
- // Invalidate column cache on add
- // We cannot refresh the View on every add because this method is called
- // when the HeaderDropZone moves Headers around, that will also refresh the view
- onAdd: function(c) {
- var me = this;
- if (!c.headerId) {
- c.headerId = 'h' + (++me.headerCounter);
- }
- me.callParent(arguments);
- me.purgeCache();
- },
-
- // Invalidate column cache on remove
- // We cannot refresh the View on every remove because this method is called
- // when the HeaderDropZone moves Headers around, that will also refresh the view
- onRemove: function(c) {
- var me = this;
- me.callParent(arguments);
- me.purgeCache();
- },
-
- afterRender: function() {
- this.callParent();
- var store = this.up('[store]').store,
- sorters = store.sorters,
- first = sorters.first(),
- hd;
-
- if (first) {
- hd = this.down('gridcolumn[dataIndex=' + first.property +']');
- if (hd) {
- hd.setSortState(first.direction, false, true);
- }
- }
- },
-
- afterLayout: function() {
- if (!this.isHeader) {
- var me = this,
- topHeaders = me.query('>gridcolumn:not([hidden])'),
- viewEl,
- firstHeaderEl,
- lastHeaderEl;
-
- me.callParent(arguments);
-
- if (topHeaders.length) {
- firstHeaderEl = topHeaders[0].el;
- if (firstHeaderEl !== me.pastFirstHeaderEl) {
- if (me.pastFirstHeaderEl) {
- me.pastFirstHeaderEl.removeCls(me.firstHeaderCls);
- }
- firstHeaderEl.addCls(me.firstHeaderCls);
- me.pastFirstHeaderEl = firstHeaderEl;
- }