I'm experiencing an issue with Ext.net TabPanel. When the page with tab panel is opened first time after the app was rebuilt it throws Uncaught TypeError: Object [object Object] has no method 'getComponent'. The problem happens each time the application is rebuilt and then disappears after page refresh. Here's JS code I use to create a tab:
It's called on menu item click:Code:@X.XScript().ScriptBlock(@"
<script>
var addMainTab = function (tabPanel, id, url, title) {
var tab = tabPanel.getComponent(id);
if (!tab) {
tab = tabPanel.add({
id : id,
title : title,
closable : true,
loader : {
url : url,
renderer : 'frame',
loadMask : {
showMask : true,
msg : 'Loading ' + url + '...'
}
}
});
}
tabPanel.setActiveTab(tab);
}
</script>
");
As I figured out some functions (getComponent, addTab and others) are not included into the definition of TabPanel at first load of the page after rebuild. Does anyone have any idea why it may happen and how it can be fixed? I'd appreciate any help.Code:menuItem.Listeners.Click.Handler = "addMainTab(#{MainTabPanel}, 'someId', 'someurl', 'Tab title')";