-
21 Apr 2009 1:29 AM #1
TabPanel: Right align some tabs
TabPanel: Right align some tabs
Hi,
is there a way to render some tabs in a TabPanel "right-aligned"?
I want the main tabs on the left side, but two tabs with a distance to the others on the right side of the panel.
Example:
[Tab1][Tab2][Tab3] <SPACER> [Right1][Right2]
Thanks for your help!
Regards, Tobias
-
21 Apr 2009 1:43 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 43
Example:
Code:<style type="text/css"> ul.x-tab-strip li.right-tab {float: right;} </style> <script type="text/javascript"> Ext.onReady(function() { new Ext.Viewport({ layout: 'fit', items: { xtype: 'tabpanel', items: [{ title: 'Tab 1' },{ title: 'Tab 2' },{ title: 'Tab 3' },{ title: 'Right 2', tabCls: 'right-tab' },{ title: 'Right 1', tabCls: 'right-tab' }], listeners: { afterlayout: function(c){ c.strip.setWidth(c.stripWrap.getWidth() - 2); } } } }); }); </script>
-
21 Apr 2009 2:28 AM #3
-
25 Sep 2012 11:24 AM #4
Can somebody please suggest how to do this in Ext 4.1.0?
Thanks.
-
29 Nov 2012 2:01 AM #5
Hi,
I'm having this problem in Ext 4.1.1 as well. is there a fix?
Thank you
-
29 Nov 2012 2:16 AM #6
How to right align the tab title buttons in tab panel on extjs 4.1.1
How to right align the tab title buttons in tab panel on extjs 4.1.1
Hello,
How do i right align the tab buttons in this version. the answer from thread
http://www.sencha.com/forum/showthre...s-in-tab-panel
isn't working for me.
[CODE]
<style type="text/css"> .my-tab {position: relative !important; float: right!important;
right:0px!important;
} .webui-centerpanel .header-tabs.x-tab-bar .x-tab {
position: relative !important;
float: right;
left: auto !important;
margin: 0 2px 0 0 !important;
border-color: #B5B5B5;
}
.webui-centerpanel .header-tabs.x-tab-bar .x-tab-bar-body {
height: 22px;
border: 0 none;
}
.webui-centerpanel .header-tabs .x-tab-bar-strip {
border-color: #b5b5b5;
background: none transparent !important;
border-width: 1px 0 0;
top: 24px;
}
</style><script type="text/javascript">Panel = Ext.create( 'Ext.panel.Panel',{
id: 'centerPanel',
cls: 'webui-centerpanel',
layout: 'fit',
items: [{
xtype: 'Ext.tab.Panel',
id: 'tab-panel',
itemCls: 'my-tab',
bodyCls: 'header-tabs-body',
layout: 'fit',
border: 0,
bodyBorder: false,
tabBar: {
height: 25
},
//toolbar
tbar: /*.....*/
}),
componentCls: 'my-tab',
items:[{
//right align tab
title: 'Configuration',
id: 'config-tab',
tabCls: 'my-tab'
}],
listeners: {
beforetabchange: function(tp, newTab, currentTab){
if (newTab.id == 'centerPanel-bctoolbar')
return false;
if (newTab.id == 'config-tab') {
CP.global.activeTab = CP.global.config;
}
if (newTab.id == 'monitor-tab') {
CP.global.activeTab = CP.global.monitor;
}
}
}
},{
//another panel
...
}]
Thank you for your help!
Regards
Tanya
-
25 Mar 2013 5:51 PM #7
Add This Code
Add This Code
As one of your tabpanel items. All following tabpanel items will be right-aligned.
Code:{ // Fill all available space tabConfig : { xtype : 'tbfill' } }
-
27 Mar 2013 3:42 AM #8
Use the below code
Use the below code
xtype: 'tabpanel',
tabBar : {
layout : {
pack : 'end'
}
},
-
12 Apr 2013 10:51 PM #9
right align
right align
dear... when i tried the right align through "float:righ", the tab title simply disappear.
-
13 Apr 2013 3:36 AM #10
Just use
layout : {
pack : 'end'
}


Reply With Quote