Wait! Looks like we don't have enough information to add this to bug database. Please follow this
template bug format.
-
viewport event not firing : version: 360
I added the viewport config to my project and added an event (initialize onViewportInitialize) but it never fires. The launch event under Application fires no problem, though. All of this was done via the Designer UI
Thanks,
John
-
Please paste the relevant code generated for app.js here
-
Here ya go...
Code:
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
viewport: {
style: 'background-color:lightBlue;',
layout: {
animation: false,
type: 'card'
}
},
views: [
'C360Container',
'MainContainer',
'WidgetBase',
'WidgetContainer',
'WidgetHousehold',
'LoginContainer'
],
name: 'MyApp',
controllers: [
'LoginController',
'MainController'
],
onViewportInitialize: function(component, options) {
console.log('viewport init');
},
launch: function() {
console.log('app launch');
var login = Ext.create('MyApp.view.LoginContainer');
Ext.Viewport.add(login);
Ext.Viewport.on([
{
event: 'initialize',
fn: 'onViewportInitialize',
scope: this
}
]);
}
});
-
Well, by the time the application's launch method runs, the viewport has already been created and its 'initialize' event has already fired. 
Is there a reason you want to attach to that particular event? It seems like it's not a useful event for the viewport since anything you'd put in its handler could just be put right in the launch method instead.
I'm not sure there's a way we can attach to that event before the viewport is created, but I'll look into it.
Jason Johnston
@lojjic
Sencha Architect Development Team
-
Thanks Jason. My goal was to log out messages from the component chane of events to familiarize myself with the framework. Just bringing it to your attention as its an option that didn't work for me.
Love the bits you guys produce. Stay frosty. John
-
Sencha Premium Member
hi try this snippet
Code:
Ext.Viewport.bodyElement.on('resize', rotate, this, { buffer: 1});