Should I extend Ext.app.Application class in Sencha Touch 2?
I have functionality which is common for several applications, for example: do something for all stores configured in the application.
If yes, how do I start the application in app.js?
Should I extend Ext.app.Application class in Sencha Touch 2? I have functionality which is
Share
I will answer for ExtJS 4.0.x / 4.1.x and SenchaTouch 2.0.x / 2.1.x
You should not extend
Ext.app.ApplicationWhy?
You only can only have one active application at a time which should (need to be) always be configured & startet by calling
Ext.application({...});.As always there are ways around this (in both frameworks) which would then allow you to use your own instance. But would not recommend it!
What would be needed?
Basically the only thing that is required is to reimplement and extend the code within the
Ext.applicationmethod so that it is capable to handle any other class thenExt.app.Application. I will just add a SenchaTouch example, for ExtJS see ExtJS4.2 section below the code.SenchaTouch example
A note to ExtJS 4.2
Sencha has announced ExtJS 4.2 which will allow us to extend from the
Ext.app.Applicationclass