PDA

View Full Version : Orientation Change



shizny
6 Jun 2011, 2:28 PM
Hello,

I'm trying to stop my app from changing the layout on an orientation change (because it messes up the layout, which is another problem) but can't seem to get it to work. I've tried setting layoutOnOrientationChange (http://dev.sencha.com/deploy/touch/docs/source/Component.html#cfg-Ext.Component-layoutOnOrientationChange): false in the config object of my viewport. What should I be doing?

mbalsam
7 Jun 2011, 3:29 AM
Have you tried to set the monitorOrientation option of the component to false?

shizny
7 Jun 2011, 7:44 AM
Didn't work for me. This is what I've got in my viewport file



apple.views.Viewport = Ext.extend(Ext.Panel, {
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
cls: 'basePanel',
componentCls: 'basePanel',
//monitorOrientation: false,
//scroll: 'vertical',
initComponent: function() {
//put instances of cards into app.views namespace
Ext.apply(apple.views, {
loginPage: new apple.views.Login(),
selectRetailerPage: new apple.views.SelectRetailer(),
selectStorePage: new apple.views.SelectStore(),
instructionsPage: new apple.views.Instructions(),
firstQuestionPage: new apple.views.BeginningQuestionOne(),
secondQuestionPage: new apple.views.BeginningQuestionTwo(),
thirdQuestionPage: new apple.views.BeginningQuestionThree(),
displayConfirmPage: new apple.views.ConfirmDisplay(),
attachPhotoPage: new apple.views.AttachPhoto(),
cardMailDetailsFormPage: new apple.views.CardMailDetailsForm(),
cardMailDiagramPage: new apple.views.CardMailDiagram(),
closingQuestionOnePage: new apple.views.ClosingQuestionOne(),
closingQuestionTwoPage: new apple.views.ClosingQuestionTwo(),
closingQuestionThreePage: new apple.views.ClosingQuestionThree(),
summaryPage: new apple.views.Summary(),
alertsPage: new apple.views.Alerts()
});
//put instances of cards into viewport
Ext.apply(this, {
items: [
apple.views.loginPage,
apple.views.selectRetailerPage,
apple.views.selectStorePage,
apple.views.instructionsPage,
apple.views.firstQuestionPage,
apple.views.secondQuestionPage,
apple.views.thirdQuestionPage,
apple.views.displayConfirmPage,
apple.views.attachPhotoPage,
apple.views.cardMailDetailsFormPage,
apple.views.cardMailDiagramPage,
apple.views.closingQuestionOnePage,
apple.views.closingQuestionTwoPage,
apple.views.closingQuestionThreePage,
apple.views.summaryPage,
apple.views.alertsPage
]
});
apple.views.Viewport.superclass.initComponent.apply(this, arguments);
},
layoutOrientation : function(orientation, w, h) {
apple.views.Viewport.superclass.layoutOrientation.call(this, orientation, w, h);
}
});