-
27 Jan 2012 12:51 AM #1
[PR4] orientationchange not working
[PR4] orientationchange not working
Hi,
a little problem with orientationchange.
in the doc the second parameter (orientation) is supposed to be a string and I have in fact the width.Code:init: function() { Ext.Viewport.on('orientationchange', 'handleOrientationChange', this, { buffer: 50 }); }, handleOrientationChange: function (v, orientation, width, height) { console.log(v, orientation, width, height); }
parameters 3 & 4 both return height
and each time the event is firing we have the same valuesCode:Ext.apply.create.Class 1280 634 634
thx
-
27 Jan 2012 6:03 AM #2
-BC ...
-
27 Jan 2012 7:32 AM #3
-
28 Jan 2012 2:26 PM #4
for those still thinking that there is a problem with orientationchange, that is the solution :HTML Code:Looks like we can't reproduce the issue or there's a problem in the test case provided.
Code://************************************************************************************************* //view/main Ext.define('mtApp.view.Main', { extend : 'Ext.Container', xtype : 'mainview', config : { fullscreen: true, layout : 'fit', html : 'test' } }); //************************************************************************************************* //controller/main Ext.define('mtApp.controller.Main', { extend: 'Ext.app.Controller', config: { profile: Ext.os.deviceType.toLowerCase(), refs : { main: { selector : 'mainview', xtype : 'mainview', autoCreate: true } } }, init: function() { Ext.Viewport.on('orientationchange', 'handleOrientationChange', this, { buffer: 50 }); }, handleOrientationChange: function (t, o, w, h) { // not working this.getMain().setHtml('orientationchange('+o+') width: ' + w + ', height: ' + h); // working console.log(Ext.Viewport.getOrientation(),Ext.Viewport.getSize().width,Ext.Viewport.getSize().height); }, updateProfile: function(profile) { this.getMain(); } }); //************************************************************************************************* Ext.application({ name : 'mtApp', views : ['Main'], controllers : ['Main'] });
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote