sencha を使用して Blackberry WebWorks プロジェクトのサンプルを作成しました。それはうまくいっています。コードは次のとおりです。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" id="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no">
<title>Hello World</title>
<script src="www/sencha.js" type="text/javascript"></script>
<script src="www/cordova2.js" type="text/javascript"></script>
<link href="www/resources/css/app.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
new Ext.application({
launch: function () {
Ext.create('Ext.Panel', {
fullscreen: true,
items: [
{
dock : 'top',
xtype: 'toolbar',
title: 'My First Test App',
height:40
},
{
xtype : 'panel',
html:"test"
}
]
});
}
});
</script>
</head>
<body></body>
</html>
このプロジェクトでは、このファイルで sencha コードを定義しました。しかし、今は、sencha コードが別のファイルにあるようにプロジェクトを作成したいと考えています。しかし、私は白い画面になっています。
誰でもこれを行う方法を教えてもらえますか?
私はこれを試しました:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" id="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no">
<title>Hello World</title>
<script src="www/sencha.js" type="text/javascript"></script>
<script src="www/cordova2.js" type="text/javascript"></script>
<script src="www/app.js" type="text/javascript"></script>
<link href="www/resources/css/app.css" rel="stylesheet" type="text/css" />
</head>
<body></body>
</html>
app.js コードは次のとおりです。
Ext.application({
name: 'SenchaDemo',
requires: [
'Ext.MessageBox'
],
views: ['SettingPanel'],
launch: function() {
// Initialize the setting view
Ext.Viewport.add(Ext.create('SenchaDemo.view.SettingPanel'));
},
onUpdated: function() {
Ext.Msg.confirm(
"Application Update",
"This application has just successfully been updated to the latest version. Reload now?",
function(buttonId) {
if(buttonId === 'yes') {
window.location.reload();
}
}
);
}
});