-
7 Apr 2012 12:05 AM #1
Difference between Ext.setup(), Ext.application() and Ext.regApplication()
Difference between Ext.setup(), Ext.application() and Ext.regApplication()
I am a newbie for Sencha touch 2.0 and just footed in this.
Could Some one Explain the difference between Ext.setup(), Ext.application() and Ext.regApplication().
In few Examples i am seeing Ext.application(), and in few Ext.regApplication(). When Googling on these i found something new, Ext.setup().
Could Some one explain difference between them and scenarios to use respective function...
Thanks in advance.
-
7 Apr 2012 1:39 PM #2Sencha - Sencha Touch Dev Team
- Join Date
- Jul 2009
- Location
- Palo Alto, California
- Posts
- 469
- Vote Rating
- 9
Ext.regApplication() is deprecated in favor of Ext.application()
Ext.setup() is the entry-point to initialize the application, including but not limited to the viewport, the event system, animation runner, logger, etc.
Ext.application() calls Ext.setup() behind-the-scene and pass whatever config you give to Ext.setup(). The only thing extra Ext.application() does is to require and create an instance of Ext.app.Application to initialize the MVC structure. The reason why some examples use Ext.setup() instead of Ext.application() is because they are tiny code snippets to demo a certain view, and doesn't need MVC at all.
Bottom line: for your applications, always use Ext.application()Sencha Touch Lead Architect
-
8 Apr 2012 11:51 PM #3
Hi Jacky,
Thanks for your response...
I used Sencha touch 2.0 and tried a small code snippet.
Ext.application({
launch: function(){
var myPanel = Ext.create("Ext.Panel",{
html: "HELLO"
});
Ext.Viewport.add(myPanel);
}
});
This Works Fine... Displays Text in Browser(Google Chrome 18.0)... But,
Ext.regApplication({
launch: function(){
var myPanel = Ext.create("Ext.Panel",{
html: "HELLO"
});
Ext.Viewport.add(myPanel);
}
});
(or)
Ext.setup({
launch: function(){
var myPanel = Ext.create("Ext.Panel",{
html: "HELLO"
});
Ext.Viewport.add(myPanel);
}
});
NOT WORKING......!!! :-(
Displays Nothing in Browser(Google Chrome 18.0).
Thanks in advance... :-)
-
8 Apr 2012 11:57 PM #4Sencha - Sencha Touch Dev Team
- Join Date
- Jul 2009
- Location
- Palo Alto, California
- Posts
- 469
- Vote Rating
- 9
As I said Ext.regApplication() is deprecated, don't use it anymore.
Ext.setup() invokes the given 'onReady' property, not 'launch'. 'launch' is Ext.app.Application specific.
Code:Ext.setup({ onReady: function(){ // ... } })Sencha Touch Lead Architect
-
9 Apr 2012 2:06 AM #5
Thanks Jacky....
That helped so much for a Clear Start for App development... :-)
Now i am quite comfortable to build a layout... I need to Change the styles, (ie) color, icons, gradients, background image. Can u plz help me on this...
-
22 Apr 2012 11:53 AM #6
-
25 Apr 2013 11:21 PM #7


Reply With Quote