Skip to content

Instantly share code, notes, and snippets.

@btoll
Created June 20, 2013 17:49
Show Gist options
  • Save btoll/5824954 to your computer and use it in GitHub Desktop.
Save btoll/5824954 to your computer and use it in GitHub Desktop.
Vertafore patch for EXTJSIV-10191
Ext.define('EXTJSIV-10191.grid.header.Container', {
override: 'Ext.grid.header.Container',
initComponent: function() {
var me = this;
me.callParent(arguments);
if (me.isColumn && (!me.items || me.items.length === 0)) {
me.isContainer = false;
me.layout = {
type: 'container',
calculate: Ext.emptyFn
};
}
// HeaderContainer and Group header needs a gridcolumn layout.
else {
me.layout = Ext.apply({
type: 'gridcolumn',
align: 'stretch'
}, me.initialConfig.layout);
// Create the owning grid's ColumnManager
// If the header isn't a column ([isColumn] or [isGroupHeader]), then it's the root header.
if (!me.isGroupHeader) {
me.isRootHeader = true;
// In the grid config, if grid.columns is a header container instance and not a columns
// config, then it currently has no knowledge of a containing grid. Create the column
// manager now and bind it to the grid later in Ext.panel.Table:initComponent().
//
// In most cases, though, grid.columns will be a config, so the grid is already known
// and the column manager can be bound to it.
me.columnManager = new Ext.grid.ColumnManager(me);
if (me.grid) {
me.grid.columnManager = me.columnManager;
}
}
}
}
});
Ext.define('EXTJSIV-10191.panel.Table', {
override: 'Ext.panel.Table',
initComponent: function() {
this.callParent(arguments);
this.columnManager = this.headerCt.columnManager;
this.headerCt.forceFit = !!this.forceFit;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment