PDA

View Full Version : Start Tab Bar from a Specif position in Tab Panel.



faizanhaider
24 May 2014, 5:51 AM
me.mainTabPanel.tabBar.setX(me.mainTabPanel.tabBar.x + me.mainLeftPanel.width + 10);
var tabBarWidth = parseInt(Ext.query('.x-main-body-tab-panel .x-horizontal-box-overflow-body')[0].style.width.split('px')[0]);
Ext.query('.x-main-body-tab-panel .x-horizontal-box-overflow-body')[0].style.width = (tabBarWidth - me.mainTabPanel.tabBar.getX() + 14) + 'px';
Ext.query('.x-main-body-tab-panel .x-tab-bar-top .x-tab-bar-strip')[0].style.left = '-' + (me.mainTabPanel.tabBar.getX() - 14) + 'px';

scottmartin
24 May 2014, 7:44 AM
You can insert a spacer on the tabBar, something like this:



Ext.onReady(function(){

Ext.create('Ext.tab.Panel', {
width: 400,
height: 400,
renderTo: document.body,
items: [{
title: 'Foo'
}, {
title: 'Bar'
}],

listeners: {
afterrender: function(panel){
var bar = panel.tabBar;
bar.insert(0,[
{
xtype: 'component',
width: 100
}
]);
}
}
});

});

faizanhaider
25 May 2014, 8:55 PM
Thanks for this solution. But this way scroll navigation starts from the left position but I want it to start from start tab. Thanks in advance.