Created
October 11, 2013 06:10
-
-
Save emayk/6930261 to your computer and use it in GitHub Desktop.
exjs-centre-region-west-extjs
This file contains hidden or 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
,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