schmidt@archomedia.com
8 Nov 2012, 5:02 AM
Hi,
based on the pandora example I tried to extend Ext.app.Application like shown in the section "Deriving from Ext.app.Application" here (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.app.Application). I get something like this:
Ext.define('AbstractApplication', {
extend: 'Ext.app.Application',
constructor: function (config) {
config = config || {};
Ext.apply(this, config);
var me = this;
me.callParent(config);
},
launch: function () {
var me = this;
me.initBar();
},
bar: function () {
console.log('bar called');
}
});
Ext.application({
extend: 'AbstractApplication',
name: 'Pandora',
autoCreateViewport: true,
models: ['Station', 'Song'],
stores: ['Stations', 'RecentSongs', 'SearchResults'],
controllers: ['Station', 'Song'],
launch: function () {
var me = this;
me.callParent();
}
});
But I get an error saying 'Error: this.callParent() was called but there's no such method (onBeforeLaunch) found in the parent class (Ext.app.Controller)' on line 'Ext.application > launch > me.callParent'
If I do it the way described here (http://www.sencha.com/forum/showthread.php?238496) with
Ext. onReady it works faultless. May somebody please tell me why the example from the docs is not working or what I'm doing wrong?
based on the pandora example I tried to extend Ext.app.Application like shown in the section "Deriving from Ext.app.Application" here (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.app.Application). I get something like this:
Ext.define('AbstractApplication', {
extend: 'Ext.app.Application',
constructor: function (config) {
config = config || {};
Ext.apply(this, config);
var me = this;
me.callParent(config);
},
launch: function () {
var me = this;
me.initBar();
},
bar: function () {
console.log('bar called');
}
});
Ext.application({
extend: 'AbstractApplication',
name: 'Pandora',
autoCreateViewport: true,
models: ['Station', 'Song'],
stores: ['Stations', 'RecentSongs', 'SearchResults'],
controllers: ['Station', 'Song'],
launch: function () {
var me = this;
me.callParent();
}
});
But I get an error saying 'Error: this.callParent() was called but there's no such method (onBeforeLaunch) found in the parent class (Ext.app.Controller)' on line 'Ext.application > launch > me.callParent'
If I do it the way described here (http://www.sencha.com/forum/showthread.php?238496) with
Ext. onReady it works faultless. May somebody please tell me why the example from the docs is not working or what I'm doing wrong?