Skip to content

Instantly share code, notes, and snippets.

@aghuddleston
Last active October 5, 2015 07:18
Show Gist options
  • Save aghuddleston/2770422 to your computer and use it in GitHub Desktop.
Save aghuddleston/2770422 to your computer and use it in GitHub Desktop.
Ext JS 4.1 Plugin to add items to the right side of a panel header
Ext.define('Ext.ux.panel.header.ExtraIcons', {
extend: 'Ext.AbstractPlugin',
alias: 'plugin.headericons',
alternateClassName: 'Ext.ux.PanelHeaderExtraIcons',
iconCls: '',
index: undefined,
headerButtons: [],
init: function(panel) {
this.panel = panel;
this.callParent();
panel.on('render', this.onAddIcons, this, {single: true});
},
onAddIcons :function () {
if (this.panel.getHeader) {
this.header = this.panel.getHeader();
} else if (this.panel.getOwnerHeaderCt) {
this.header = this.panel.getOwnerHeaderCt();
}
this.header.insert(this.index || this.header.items.length, this.headerButtons);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment