I've this code for creating a tabpanel:
Code:
var bottomToolbar = { xtype: "tabpanel",
id: 'navigationtab',
styleHtmlContent: true,
plugins: [new Ext.ux.touch.SwipeTabs()],
tabBar: {
docked: 'bottom',
ui: 'dark',
layout: {
pack: 'center'
}
},
activeTab: 0,
deferredRender: false,
defaults: {
scroll: 'vertical'
},
items: [
{
//each item in a tabpanel requires the title configuration. this is displayed
//on the tab for this item
title: 'Home',
iconCls: 'home',
//next we give it some content
items: {
xtype: 'panel_home'
},
//then a custom cls so we can style it
cls: 'card1'
},
{
title: 'Radiologie',
iconCls: 'radiology',
items: {
xtype: 'panel_radiology',
centered: true
},
cls: 'card2'
},
{
title: 'Documenten',
items: {
html: '3',
centered: true
},
cls: 'card3'
}
]
};
The tabpanel is showing correctly in the UI, but when I click in the tabpanel at one of the images. It won't slide to that page. However when I remove the id property it all works fine. I need the id property, because I need to find this control in the controller. I've tried to use the itemId property and then in the controller trying to find the control with Ext.Container.getComponent, but then I get an error. In the Chrome console it tells me that it can;t find getComponent of [object]. I also tried the tabfix.js this I found on the internet.
Code:
Ext.define('NormaMob.extends.tabfix', { override: 'Ext.tab.Panel',
doTabChange: function (tabBar, newTab) {
this.setActiveItem(tabBar.indexOf(newTab));
}
});
When I put an alert in this function I see it sets the correct index to the ActiveItem, but the panels still won't slide. When I remove the id property and use itemId it does work fine, but I can't get the control with Ext.Container.getComponent.
Is this a bug in the tappanel? I'm using Sencha Touch 2.0.1.1
Please advise.
With best regards,
Alex van der Lans