Reputation: 702
I want to create an base ViewController for all other controllers used in an ExtJS app.
The problem is that ExtJs is looking for the base class in /classic/src/view instead of /app/view....
Here is an example: in /app/view/base/BaseController.js
Ext.define('myApp.view.base.BaseController', {
extend: 'Ext.app.ViewController',
doStuff: function(msg) {
alert(msg);
}
});
in /app/view/another/AnotherController.js
Ext.define('myApp.view.another.AnotherController', {
extend: 'myApp.view.base.BaseController',
onButtonClick: function() {
doStuff('Button clicked');
}
});
in /app/classic/src/view/another/Another.js
Ext.define('myApp.view.another.Another', {
extend: 'Ext.panel.Panel',
xtype: 'another',
alias: 'view.another',
id: 'panel_another',
controller: 'another',
items: [{
xtype: 'button',
text: 'The Button',
handler: onButtonClick
}]
});
However when i run the app, ExtJs throws an error saying that /classic/src/view/base/BaseController.js was not found!
What am i doing wrong here?
Thank you for your time, and for your help!
Upvotes: 0
Views: 261
Reputation:
Yes, agree above answer.You can also perform sencha app refresh.You can try this in DEV mode.Please try this also.
Upvotes: 0
Reputation: 902
You just try building your app by sencha app build
.It will solve this issue.
Upvotes: 1