PDA

View Full Version : Ext.device.Connection shows blank white screen on ipad



jaami
10 Jul 2013, 2:40 AM
when this line is added

requires: ['Ext.device.Connection' ],

and app is build with phonegap, a white blank screen is shown on device. If i remove the require of Ext.device.Connection then app run and shows the view. is there something missing in my code? Please check.

index.html


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>tuch_db_link</title>
<script>
var Ext = Ext || {};
Ext.theme = {
name: "Default"
};
</script>
<script src="http://cdn.sencha.com/touch/sencha-touch-2.2.1/sencha-touch-all-debug.js"></script>
<link rel="stylesheet" href="http://cdn.sencha.com/touch/sencha-touch-2.2.1/resources/css-debug/sencha-touch.css">
<link rel="stylesheet" href="pia.css">

<script src="phonegap.js"></script>


<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>



app.js


Ext.Loader.setConfig({


});


//Ext.require('Ext.device.Connection');


Ext.application({

requires: [
'Ext.device.Connection'
],


name: "MyApp",


models: [
'Person'
],


stores: [
'PeopleStore'
],


views: [




'SQLite',
'MyDataView',
'MyList',
],


controllers: [
'MainCont'
],


fullscreen: true,




launch: function(){
Ext.create("MyApp.view.SQLite",{fullscreen: true});
// Ext.Msg.alert("Application launched");
}





});





controller MainCont.js


Ext.define('MyApp.controller.MainCont', {
extend: 'Ext.app.Controller',

config:{
control: {
"button[action=loginBtnTap]": {
//tap: 'onLoginBtnTap'
tap: 'callNativeAPI'
}


}
},


callNativeAPI: function(button, e, eOpts){
console.log('call to native API method');
if (Ext.device.Connection.isOnline()) {
Ext.Msg.alert('You are currently connected via ' + Ext.device.Connection.getType());
}
else {
Ext.Msg.alert('You are not currently connected');
}


},




});


view SQLite.js


Ext.define('MyApp.view.SQLite', {
extend: 'Ext.form.Panel',


config: {
id: 'LoginFormID',
items: [
{
xtype: 'container',
height: 500,
width: '100%',
layout: {
type: 'fit'
},
items: [
{
xtype: 'textfield',
top: '10%',
zIndex: 1,
label: 'User:',
labelWidth: '35%'
},
{
xtype: 'passwordfield',
top: '33%',
zIndex: 1,
label: 'Password:',
labelWidth: '35%'
},
{
xtype: 'button',
top: '55%',
zIndex: 1,
action: 'loginBtnTap',
text: 'Login Now'
},
{
xtype: 'mylist',
top: '75%',
width: '100%',
height: '35%'
}


]
}
]
}


});

jaami
11 Jul 2013, 12:27 AM
Can someone help to fix this problem?

jaami
11 Jul 2013, 6:36 AM
Ext.Loader.setPath({
'Ext':'sdk/src'
});
added setPath method in code but this time Connection.js is not found. Where is Connection.js?

jaami
12 Jul 2013, 12:30 AM
Is there Something wrong with post that include code in it? I get no response whenever code is also posted.

jaami
13 Jul 2013, 12:30 AM
Nobody facing same problem?

jaami
15 Jul 2013, 6:36 PM
:))
Look like Mr. Cow boy is on vacation.