Sencha Touch 单击“视图”上的任意位置可更改活动项目
我正在 Sencha Touch 中草拟一个应用程序。在添加用于登录和加载外部数据的实际逻辑之前,我正在验证卡之间的移动是否正确。
我的问题是,无论哪个视图处于活动状态,单击/点击视图上的任意位置都会将活动项目更改为 app.views.buildingList。
我正在使用 Sencha Touch 1.1、Phonegap 1.3.0 和 XCode 4 (iOS 5 SDK)。
任何线索表示赞赏!
Viewport.js
app.views.Viewport = Ext.extend(Ext.Panel, {
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
initComponent: function() {
Ext.apply(app.views, {
login: new app.views.Login(),
plantDetail: new app.views.PlantDetail(),
buildingList: new app.views.BuildingList()
});
Ext.apply(this, {
items: [
app.views.login,
app.views.plantDetail,
app.views.buildingList
]
});
app.views.Viewport.superclass.initComponent.apply(this, arguments);
}
});
登录.js
app.views.Login = Ext.extend(Ext.Panel, {
fullscreen: true,
dockedItems: [
{
dock : 'top',
xtype: 'panel',
height: 70,
html: '<img src="images/logo.jpg"/>'
},
{
xtype: 'textfield',
name : 'user',
placeHolder: 'Username',
cls: 'loginBox',
},
{
xtype: 'passwordfield',
name : 'password',
placeHolder: 'Password',
cls: 'loginBox'
},
{
xtype: 'button',
text : 'Login',
cls: 'standardButton',
listeners: {
'tap': function () {
Ext.dispatch({
controller: app.controllers.viewController,
action: 'index',
animation: {type:'slide', direction:'left'}
});
}
}
},
{
xtype: 'spacer',
html: '<div style="text-align: center; font-size: 14px; padding: 10px; margin-top: 10px;">Forgot Password?</div>'
},
{
xtype: 'button',
cls: 'standardButton',
text : 'Retrieve Password'
},
]
});
I am in the process of roughing out an application in Sencha Touch. I'm at the point where I'm verifying that the movement between cards is correct before I add the actual logic for logging in and loading external data.
My problem is that, regardless of which view is active, clicking/tapping anywhere on the view will change the active item to app.views.buildingList.
I am using Sencha Touch 1.1, Phonegap 1.3.0 and XCode 4 (iOS 5 SDK).
Any clues are appreciated!
Viewport.js
app.views.Viewport = Ext.extend(Ext.Panel, {
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
initComponent: function() {
Ext.apply(app.views, {
login: new app.views.Login(),
plantDetail: new app.views.PlantDetail(),
buildingList: new app.views.BuildingList()
});
Ext.apply(this, {
items: [
app.views.login,
app.views.plantDetail,
app.views.buildingList
]
});
app.views.Viewport.superclass.initComponent.apply(this, arguments);
}
});
Login.js
app.views.Login = Ext.extend(Ext.Panel, {
fullscreen: true,
dockedItems: [
{
dock : 'top',
xtype: 'panel',
height: 70,
html: '<img src="images/logo.jpg"/>'
},
{
xtype: 'textfield',
name : 'user',
placeHolder: 'Username',
cls: 'loginBox',
},
{
xtype: 'passwordfield',
name : 'password',
placeHolder: 'Password',
cls: 'loginBox'
},
{
xtype: 'button',
text : 'Login',
cls: 'standardButton',
listeners: {
'tap': function () {
Ext.dispatch({
controller: app.controllers.viewController,
action: 'index',
animation: {type:'slide', direction:'left'}
});
}
}
},
{
xtype: 'spacer',
html: '<div style="text-align: center; font-size: 14px; padding: 10px; margin-top: 10px;">Forgot Password?</div>'
},
{
xtype: 'button',
cls: 'standardButton',
text : 'Retrieve Password'
},
]
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是因为您有:
还将应用程序的名称从
app
更改为其他名称,因为这与 android PhoneGap 存在命名冲突。It's probably because you have:
Also change your app's name from
app
to something else since that has naming conflicts with android phonegap.