View Full Version : Is orientation locking a planned feature?

17 Jul 2012, 5:00 PM
Our app (for iOS and Android) requires the ability to lock the current orientation and force specific orientations programmatically on the device. Currently we implement this as a native PhoneGap plugin. However, we would really like to be able to switch to using just the Sencha packaging tool, and this is the only feature preventing us from doing so. Sencha supports other native operations; is this a planned feature or are we forever stuck with using PhoneGap for this functionality?

19 Jul 2012, 4:21 AM
Layouts are CSS based so we don't have that control to prevent things from being resized.

Samuel Horwitz
19 Jul 2012, 10:20 AM
Just to expand on that point, because I feel I've had to explain it to a bunch of people in person, the best way to look at orientation in browser is to realize that the device handles portrait/landscape orientation mode and then passes that to the app. In this case the app is the browser. The Sencha project meanwhile is just a website technically. And Safari or whatever browser is being passed orientation information simply handles these changes as a window resize. So orientation changing on the website level (in browser) is nothing more than resizing a window. So if the device orientation is not locked, then the browser will rotate with the device and the website will be re-rendered in a different window dimension.

20 Jul 2012, 3:00 PM
This was a way of locking components in sencha touch 1

beforeorientationchange: function(thisPnl, orientation, width, height) {return false;}

I wonder is it possible to apply the above to the new api below?

Ext.device.Orientation.on('orientation', function(e) {


20 Jul 2012, 6:52 PM
In ST1, layouts were JavaScript based. In ST2, layouts are CSS based so we lost control in some ways.