Last active
October 5, 2015 07:18
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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