schuc
12 Oct 2012, 4:05 AM
Hi everybody!
I have a strange behaviour in my controller class.
I'm developing with Ext js 4.1.2, MVC - style
I call my controller class in app.js
Ext.application(
{
name: 'ServiceRequest',
appFolder: 'app',
autoCreateViewport: true,
controllers:
[
'CompanyController',
'FacilityController'
]
etc.
});
..and here my Controller class :
Ext.define('ServiceRequest.controller.FacilityController',
{
extend: 'Ext.app.Controller',
refs:[{
ref: 'WestPanel',
selector: 'viewport > westPanelView'
},{
ref: 'LoadCompanyButton',
selector: 'viewport > loadcompanybutton'
}],
config:
{
facilityManager : '',
facilityStore: '',
self: this
},
//call init config
constructor: function(config)
{
this.initConfig(config);
this.setFacilityManager(Ext.create('ServiceRequest.view.FacilityControlManager'));
this.setFacilityStore(Ext.create('ServiceRequest.store.FacilityStore'));
this.callParent();
},
//set handler
init: function()
{
/*
this.control({
//the 'view'
'loadcompanybutton':
{
//the listening event
click: this.onReloadTreeDataClicked
},
//Toolbar click handler in west-panel for button btLoad
'#btLoad':
{
click: this.onToolbarLoadClicked
}
});
*/
}
})
When i run the app without disabling the code in the init call i get an
TypeError: this.application is undefined
Even if i only call the this.control({}) i get the error.
In the same app i created an other controller, where i did similiar the same, it works.
Thanks a lot for any suggestion and help with my problem.
cheers Thomas
I have a strange behaviour in my controller class.
I'm developing with Ext js 4.1.2, MVC - style
I call my controller class in app.js
Ext.application(
{
name: 'ServiceRequest',
appFolder: 'app',
autoCreateViewport: true,
controllers:
[
'CompanyController',
'FacilityController'
]
etc.
});
..and here my Controller class :
Ext.define('ServiceRequest.controller.FacilityController',
{
extend: 'Ext.app.Controller',
refs:[{
ref: 'WestPanel',
selector: 'viewport > westPanelView'
},{
ref: 'LoadCompanyButton',
selector: 'viewport > loadcompanybutton'
}],
config:
{
facilityManager : '',
facilityStore: '',
self: this
},
//call init config
constructor: function(config)
{
this.initConfig(config);
this.setFacilityManager(Ext.create('ServiceRequest.view.FacilityControlManager'));
this.setFacilityStore(Ext.create('ServiceRequest.store.FacilityStore'));
this.callParent();
},
//set handler
init: function()
{
/*
this.control({
//the 'view'
'loadcompanybutton':
{
//the listening event
click: this.onReloadTreeDataClicked
},
//Toolbar click handler in west-panel for button btLoad
'#btLoad':
{
click: this.onToolbarLoadClicked
}
});
*/
}
})
When i run the app without disabling the code in the init call i get an
TypeError: this.application is undefined
Even if i only call the this.control({}) i get the error.
In the same app i created an other controller, where i did similiar the same, it works.
Thanks a lot for any suggestion and help with my problem.
cheers Thomas