I have a view which contains a tab control with 2 tabs. I have defined an alias for each tab, in this format:
alias: 'widget.contenttab'
I am trying to access 'contenttab' in the controller but it says it is not defined:
contenttab is not defined
I am trying to set the html content of the tab in a select handler in the controller:
Ext.define('BP.controller.Induction', {
extend: 'Ext.app.Controller',
views: [
'induction.Binder',
'induction.LeftPage',
'induction.RightPage',
],
stores: [
'Sections',
'Categories',
'Tasks'
],
models: [
'Section',
'Category',
'Task'
],
init: function() {
this.control({
'grid[xtype=categorygrid]': {
itemclick: this.onItemClick
}
});
console.log('Initialized Induction!');
},
onItemClick: function(e, d) {
console.log(d.data.category_id);
this.getCategoriesStore().load({params:{'id':d.data.category_id}}, {
success: function(category) {
console.log("Category: " + category.get('name'));
},
error: function(e) {
console.log(e);
}
});
contenttab.html = 'test'; // produces error
}
});
The 'contenttab' is within my RightPage view. The line which produces an error ultimately needs to reside within the success callback function - but this isn't getting fired (I have created another question here for that issue Extjs store load success handler not getting fired
Any guidance appreciated, thanks.