我使用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();
}
}
);
}
});
答案 0 :(得分:0)
对于Sencha而不是WebWorks SDK来说,这更是一个问题。我不确定是否有可能像那样崩溃。有关设置项目结构的更多信息,请参阅以下链接。
http://docs.sencha.com/touch/2-0/#!/guide/command
由于