TabPanelのタブ幅とタブ高さを設定するにはどうすればよいですか?
私は試した:
var myTabPanel = Ext.create('Ext.TabPanel', {
fullscreen: true,
tabBarPosition: 'top',
resizeTabs: true,
tabWidth: 300,
//minTabWidth: 300
....
しかし、それは機能しません
TabPanelのタブ幅とタブ高さを設定するにはどうすればよいですか?
私は試した:
var myTabPanel = Ext.create('Ext.TabPanel', {
fullscreen: true,
tabBarPosition: 'top',
resizeTabs: true,
tabWidth: 300,
//minTabWidth: 300
....
しかし、それは機能しません
css
煎茶ファイルの中で起こっているのはそれだけです。そこで変更する必要があります。
良いニュース、
私はこれをプログラムで行う方法を見つけました。
//assuming you are using the MVC structure as suggested
/*In the controller class of your view with the tab panel you must have reference to the tab panel in refs config.
The reference name for this case will be: myTabpanel
*/
//somewhere in the controller class
var tabPanelItems = this.getMyTabpanel().getItems; //get all the items inside the tab panel (if i'm not mistaken this will also return some "extra" item which is not panel
for (var i = 0; i < panels.length; i++) {
//due to that extra item i mentioned, need to make sure current item is a tab by confirming "tab" property existence
if (panels.items[i].tab) {
panels.items[i].setWidth('100px');
panels.items[i].setHeight('25px');
}
}
そしてそれだけです。重要な点は、タブパネル(パネル付きタブ)であるため、最初にタブパーツのみを構成するには、最初にタブパーツを取得する必要があります。それ以外の場合は、デフォルトでパネルパーツのみを構成します。