StayArrr
5 Feb 2011, 8:27 AM
Hi all,
I am new to Sencha Touch, but fall in love a little bit ;)
I followed the tutorial provided here: http://www.sencha.com/learn/Tutorial:A_Sencha_Touch_MVC_application_with_PhoneGap
All works well on simulator with device iPhone - but if I change the device to iPad I do not get alerts and there is no Viewport loaded. For what I mean:
Ext.regApplication
({
name: 'app',
launch: function() {
this.launched = true;
this.mainLaunch();
},
mainLaunch: function() {
if (!device || !this.launched) {return;}
console.log('main launched');
this.views.viewport = new this.views.Viewport();
}
});
and the Viewport.js:
app.views.Viewport = Ext.extend(Ext.Panel, {
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
initComponent: function() {
//put instances of cards into app.views namespace
Ext.apply(app.views, {
//contactsList: new app.views.ContactsList(),
//contactDetail: new app.views.ContactDetail(),
//contactForm: new app.views.ContactForm()
});
//put instances of cards into viewport
Ext.apply(this, {
items: [
//app.views.contactsList,
//app.views.contactDetail,
//app.views.contactForm,
]
});
app.views.Viewport.superclass.initComponent.apply(this, arguments);
alert("Viewport ready");
}
});
My Question: What am I do wrong?
I am new to Sencha Touch, but fall in love a little bit ;)
I followed the tutorial provided here: http://www.sencha.com/learn/Tutorial:A_Sencha_Touch_MVC_application_with_PhoneGap
All works well on simulator with device iPhone - but if I change the device to iPad I do not get alerts and there is no Viewport loaded. For what I mean:
Ext.regApplication
({
name: 'app',
launch: function() {
this.launched = true;
this.mainLaunch();
},
mainLaunch: function() {
if (!device || !this.launched) {return;}
console.log('main launched');
this.views.viewport = new this.views.Viewport();
}
});
and the Viewport.js:
app.views.Viewport = Ext.extend(Ext.Panel, {
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
initComponent: function() {
//put instances of cards into app.views namespace
Ext.apply(app.views, {
//contactsList: new app.views.ContactsList(),
//contactDetail: new app.views.ContactDetail(),
//contactForm: new app.views.ContactForm()
});
//put instances of cards into viewport
Ext.apply(this, {
items: [
//app.views.contactsList,
//app.views.contactDetail,
//app.views.contactForm,
]
});
app.views.Viewport.superclass.initComponent.apply(this, arguments);
alert("Viewport ready");
}
});
My Question: What am I do wrong?