1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2008
    Posts
    126
    Answers
    1
    Vote Rating
    1
    jonjanisch is on a distinguished road

      1  

    Default Answered: New to extjs, MVC tutorial onPanelRendered not called

    Answered: New to extjs, MVC tutorial onPanelRendered not called


    Hi, I'm new to ExtJS and JS in general. I'm just getting started with the basic MVC tutorial and I'm having issues: http://docs.sencha.com/ext-js/4-0/#!...n_architecture

    I'm using ext-4.1.0-beta-3.

    Code:
    Ext.require('Ext.container.Viewport');
    
    
    Ext.application({
        name: 'HelloExt',
        controllers: [
            'Users'
        ],
        launch: function() {
            Ext.create('Ext.container.Viewport', {
                layout: 'fit',
                items: [
                    {
                        xtype: 'panel',
                        title: 'Hello Ext',
                        html : 'Hello! Welcome to Ext JS.'
                    }
                ]
            });
        }
    });
    * The getting started guide said I should see a warning in the console and I should add the Ext.require line to prevent this. I never saw any error regardless if this line is included or excluded in either Chrome's console or firebug.

    That's not a problem though. My Users controller looks like this:

    Code:
    Ext.define('HelloExt.controller.Users', {
        extend: 'Ext.app.Controller',
        
        init: function() {
            this.control({
                'viewport > panel': {
                    render: this.onPanelRendered
                }
            });
            console.log('Users controller initialized');
        },
        
        onPanelRendered: function() {
            console.log("The panel was rendered");
        }
    });
    'Users controller initialized' is outputted to the console, but it seems onPanelRendered is never getting executed. Actually, being new to JS I'm not even sure how to debug this. In firebug, I put a breakpoint in the control method, but the breakpoints appear to be removed as soon as I refresh the page.

    The only change I made from the Getting Started 'Hello World' tutorial was adding xtype: 'panel' to app.js to match the account manager app in the MVC tutorial. Am I missing something? I don't see any errors or warnings in the firebug or chrome console.

    Thanks

  2. beta 3 had a bug where the render and afterrender events wouldn't make it to the controller. This has been fixed for the next release.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,604
    Answers
    3448
    Vote Rating
    818
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    beta 3 had a bug where the render and afterrender events wouldn't make it to the controller. This has been fixed for the next release.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Ext GWT Premium Member
    Join Date
    Oct 2008
    Posts
    126
    Answers
    1
    Vote Rating
    1
    jonjanisch is on a distinguished road

      0  

    Default


    Thanks. That was my first guess, but I figured if it was in the Hello World example, I must be doing something wrong.

Thread Participants: 1