Results 1 to 6 of 6

Thread: viewport event not firing : version: 360

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    559
    Vote Rating
    44
      0  

    Default 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

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Vote Rating
    147
      0  

    Default

    Please paste the relevant code generated for app.js here
    Aaron Conran
    @aconran

  3. #3
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    559
    Vote Rating
    44
      0  

    Default

    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
            }
            ]);
        }
    
    
    });

  4. #4
    Sencha User jjohnston's Avatar
    Join Date
    Sep 2010
    Posts
    567
    Vote Rating
    21
      0  

    Default

    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

  5. #5
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    559
    Vote Rating
    44
      0  

    Default

    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

  6. #6
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    13
    Vote Rating
    0
      0  

    Default

    hi try this snippet

    Code:
    Ext.Viewport.bodyElement.on('resize', rotate, this, { buffer: 1});

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •