PDA

View Full Version : TabPanel items to right corner



DM SINGH
24 Oct 2013, 12:50 AM
hi,
How can i align last item of tabPanel to right like below.....

46529

slemmon
25 Oct 2013, 11:14 PM
The tabPanel's tabBar is a container with an hbox layout so what you can do is after the tabPanel is rendered get its tabBar and insert a generic component with flex: 1 to take up all available space just before the last tab. Here's an example:



Ext.create('Ext.tab.Panel', {
width: 400,
height: 400,
renderTo: document.body,
items: [{
title: 'Foo'
}, {
title: 'Bar',
tabConfig: {
title: 'Custom Title',
tooltip: 'A button tooltip'
}
}],
listeners: {
afterrender: function (tp) {
tp.tabBar.insert(tp.items.getCount() - 1, {
xtype: 'component',
flex: 1
});
}
}
});