Thank you for reporting this bug. We will make it our priority to review this report.
-
Sencha Premium User
[FIXED-508] 0.99 Fullscreen does not work with Ext.regApplication()
HTML Code:
Ext.regApplication({
launch: function(){
...
}
})
does not call the
HTML Code:
Ext.Viewport.init()
internally.
So on the iPhone fullscreen does not work with:
HTML Code:
Ext.regApplication({
name: 'App',
launch: function() {
this.viewport = new Ext.Panel({
fullscreen: true,
id : 'mainPanel',
layout: 'card',
items : [
{
html: 'Welcome to My App!'
}
]
});
}
});
but fullscreen works with Ext.setup() cause this call internally Ext.Viewport.init()
HTML Code:
Ext.setup({
onReady: function() {
new Ext.Panel( {
fullscreen: true,
html: 'test'
});
}
});
-
Sencha User
Thanks for the bug report.
-
Touch Premium Member
This appears to still be an issue with 1.0. Is there a patch or workaround available? This is proving to be a show stopper for something we are trying to accomplish.
-
Sencha Premium User
You have do to do something like
PHP Code:
Ext.regApplication('Contacts', {
defaultTarget: "viewport",
defaultUrl : 'Contact/index',
name : "Contacts",
useHistory : true,
launch: function() {
this.viewport = new Contacts.Viewport({
application: this
});
}
});
and
PHP Code:
Contacts.Viewport = Ext.extend(Ext.Panel, {
id : 'viewport',
layout : 'card',
fullscreen: true
});
-
Touch Premium Member
Hmmm... Exactly what I have and the app still does not show up in fullscreen.
-
Sencha Premium User

Originally Posted by
awfreeman
Hmmm... Exactly what I have and the app still does not show up in fullscreen.
yeap sorry, bug still exists you have still have to wrap you app in ext.setup
PHP Code:
Ext.setup({
onReady: function() {
Ext.regApplication('Contacts', {
defaultTarget: "viewport",
defaultUrl : 'Contact/index',
name : "Contacts",
useHistory : true,
launch: function() {
this.viewport = new Contacts.Viewport({
application: this
});
}
});
}
});
-
Touch Premium Member
You had given all of the pieces to begin with, but I had not understood what you were getting at when you said to wrap with Ext.setup. I didn't think to use it to wrap the Ext.regApplication block. Thank you! I will give it a shot and confirm your solution.
-
This has been addressed in 1.0.2
Sencha Touch Lead Architect
-
Sencha Premium Member
Is 1.0.2 the one that is downloaded now? I am still having viewport init problems with 1.0.1. I have added the following to my launch event :
Code:
Ext.Viewport.init();
this.viewport = new myApp.Viewport({
application: this,
......
});
Ext.Viewport.onOrientationChange();
But I notice an error on line 22567 of sencha-touch.js when I am calling the Ext.Viewport.init() directly:
Code:
init: function(fn) {
var me = this,
stretchSize = Math.max(window.innerHeight, window.innerWidth) * 2,
body = Ext.getBody();
me.updateOrientation();
this.initialHeight = window.innerHeight;
this.initialOrientation = this.orientation;
body.setHeight(stretchSize);
this.scrollToTop();
setTimeout(function() {
me.scrollToTop();
me.initialHeight = Math.max(me.initialHeight, window.innerHeight);
//fn(); <=== WHAT IS THIS SUPPOSED TO DO?
me.updateBodySize();
}, 500);
},
Also, to make the iPhone address bar disappear, I use the typical code in the html file:
Code:
<meta name="viewport" content="height=device-height,width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
And then on the body load:
<body onorientationchange="setTimeout(function(){window.scrollTo(0,1)},100);"; onload="setTimeout(function(){window.scrollTo(0,1)},100);">
That META tag now throws 4-5 errors about the attributes not being recognized and the page is not rendering correctly on the phone if that meta tag is included, though Chrome allows it and will display the viewport correctly.
Are all these items related to the fact that the Viewport is not being properly initialized under 1.0.1 Touch MVC? If so, need to know when O can get a hold of 1.0.2...as I need it yesterday
-
Sencha Premium User
fn(); <===
WHAT IS THIS SUPPOSED TO DO?
Ext.Viewport.init can have a function as argument
Ext.Viewport.init(function(){dosomething();});
this function is called on your mentioned place (fn()