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'
},
]
});
It's probably because you have:
app.views.Login = Ext.extend(Ext.Panel, {
fullscreen: true, //Only your viewport should be fullscreen
Also change your app's name from app
to something else since that has naming conflicts with android phonegap.