-
2 Dec 2011 12:13 AM #1
PhoneGap white screen "onLaunch" in a Controller
PhoneGap white screen "onLaunch" in a Controller
Hi,
When you build a panel an onLaunch in a Controller only a white screen appear with PhoneGap, but works fine in a browser, sample :
app/app.js:
Code:Ext.Loader.setConfig({ enabled: true }); Ext.application({ name: 'Test', controllers: ['Control'] });
app/controller/control.js:
Any solution ? Perhaps can we said to the controller "wait for PhoneGap" ?Code:Ext.define('Test.controller.Control', { extend: 'Ext.app.Controller', onLaunch: function() { var panel = Ext.create('Ext.Panel', { items: [ { dock : 'top', xtype: 'toolbar', title: 'Standard Titlebar' }, { dock : 'top', xtype: 'toolbar', ui : 'light', items: [ { text: 'Test Button' } ] } ], html: 'Testing' }); Ext.Viewport.add(panel); Ext.Viewport.setActiveItem(0); } });
Thx
-
2 Dec 2011 2:13 AM #2
Are you using IOS4.3 or IOS5 in the simulator ?
-
2 Dec 2011 2:15 AM #3
Sorry, it's for an Android app. I'm trying with the 3.2 API level.
-
2 Dec 2011 5:59 AM #4
But any suggestion would be appreciated...
-
2 Dec 2011 6:06 AM #5
Check if the "deviceready" event is correctly fired, which ST2.0 version do you use?
-
2 Dec 2011 6:24 AM #6
I'm not aware about this "device ready event", can you show me a sample ?
I'm using ST2 PR2.
Thx
-
2 Dec 2011 7:02 AM #7
It is a phonegap event that ST2.0pr2 waits to start. It seems broken.
Try to apply the patch there:
https://github.com/mgcrea/sencha-tou...3cd9719057a0a4
-
2 Dec 2011 7:04 AM #8
Hum, since your on android, that won't work. Try to add sth like this in your html:
Code:<script type="text/javascript"> document.addEventListener("deviceready", function() { console.warn('deviceready!'); }); </script>
-
2 Dec 2011 7:20 AM #9
Finally it's seems to work with this patch ! Do you know where can I find mimimized file ? ST2 team already know the bug ?
Thank you Olouvignes.
Guys be careful with the casse "control.js != Control.js"...
-
3 Dec 2011 3:48 PM #10
So, Ext.os.deviceType on Android is Desktop?
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.


Reply With Quote