Skip to content

Instantly share code, notes, and snippets.

@emayk
Created October 11, 2013 06:10
Show Gist options
  • Save emayk/6930261 to your computer and use it in GitHub Desktop.
Save emayk/6930261 to your computer and use it in GitHub Desktop.
exjs-centre-region-west-extjs
,init: function() {
var me = this;
me.control({
'viewport button[action=list-users]': {
click: me.showListUsers
}
...
});
}
/**
* Method which will show the user list
* @param {Ext.button.Button} btn The selected button
*/
,showListUsers: function(btn, evt, opt) {
var me = this,
tabpanel = btn.up('viewport').down('#center-tabpanel'),
activeTab;
activeTab = tabpanel.items.findBy(function( aba ){
return aba.title === btn.text;
});
if(!activeTab){
activeTab = tabpanel.add({
title: btn.text
,closable: true
,layout: 'fit'
,autoDestroy: true
,items: [{
xtype: 'userlist'
}]
});
}
tabpanel.setActiveTab(activeTab);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment