-
11 Nov 2011 5:04 AM #1
[PR2] Ext.application broken ?
[PR2] Ext.application broken ?
This basic code is not working anymore with PR2 on my computer, nothing on the console. Any ideas why ?
Code:Ext.application({ name: 'Sencha', launch: function() { alert('launched'); } });
-
11 Nov 2011 8:49 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
We'll check into it. Thank you for the report.
-
11 Nov 2011 10:07 AM #3
Which Sencha Touch js file are you using? I've tested sencha-touch-all.js and sencha-touch-all-debug.js and they both work fine with this code.
-
12 Nov 2011 2:54 AM #4
-
13 Nov 2011 12:27 PM #5
ST2.0PR1 clearly conflicts with phonegap somehow.
Tried phonegap-1.1.0.js & phonegap-1.2.0.js -> crashes (with no error on both).
Works well when phonegap is not embedded in the webpage.
-
13 Nov 2011 4:45 PM #6
Is this related to the bug report I filed regarding the alternate class name for Ext.application? I am using PhoneGap 1.2.0 and my app is broken too. I'm debugging it now to figure out what happened...
http://www.sencha.com/forum/showthre...-name-conflict
-
13 Nov 2011 4:55 PM #7
It seems that Phonegap can't fire "deviceready" event that PR2 requires for starting up. Quite strange.
A quick fix can be to replace l.8846 (debug-w-comments) from :
to :Code:if (Ext.browser.is.PhoneGap) {
We need sth smarter though...Code:if (false && Ext.browser.is.PhoneGap) {
-
13 Nov 2011 5:12 PM #8
PhoneGap 1.2.0 seems to fire that just fine. Do you use something like this:
Code:Ext.setup({ viewport: { autoMaximize: false }, onReady: function() { console.log("onReady:"); var app = new Ext.app.Application({ name: 'MyApp', autoCreateViewport: false, launch: function() { console.log('launch:'); } });
}
});
-
13 Nov 2011 5:14 PM #9
Nope sth like :
Always had "Ext.setup already launched" when wrapped in Ext.setup... Worked well so far.Code:Ext.application({ name: 'MyApp', controllers: [], autoCreateViewport: true, viewport: { autoMaximize: false }, init: function() { d&&console.log(this.name + '.application#init', [this, arguments]); }, launch: function() { this.launched = true; this.mainLaunch(); }, mainLaunch: function() { d&&console.log(this.name + '.application#mainLaunch', [this, arguments]); if ((Ext.os.deviceType == 'Phone' && !device) || !this.launched) {return;} } });
-
17 Nov 2011 11:23 AM #10
I'm running the following code with Phone Gap 1.2.0 with no problems:
I've tested on the simulator on both iOS 4.3 and 5, and iOS 5 on device.Code:Ext.application({ name: 'Sencha', launch: function() { alert('launched'); } });
Please ensure you have included PhoneGap before you include ST:
Code:<!DOCTYPE HTML> <html lang="en-US"> <head> <base href="http://rob.local/test/phonegap/" /> <meta charset="UTF-8"> <title>PhoneGap Test</title> <!-- Include PhoneGap first --> <script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script> <!-- Include Sencha Touch --> <script type="text/javascript" src="../../../touch/sencha-touch.js"></script> <!-- Include the application --> <script type="text/javascript" src="app.js"></script> </head> <body></body> </html>Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1020
in
2.0.


Reply With Quote