Results 1 to 3 of 3

Thread: ExtJs 4.0 Tutorial issues.

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default Answered: ExtJs 4.0 Tutorial issues.

    Hello, I am trying to go through this tutorial:

    http://docs.sencha.com/ext-js/4-0/#!...n_architecture

    I am getting to the part where the view is supposed to become visible, however, instead I get an error in the console that says 'TypeError: name is undefined'.

    I believe all my code is correct, I have index.html with:

    Code:
    <html>
    <head>
        <title>Hello Ext</title>
    
        <link rel="stylesheet" type="text/css" href="ExtJs/ext-4.1.1a/resources/css/ext-all.css">
        <script type="text/javascript" src="ExtJs/ext-4.1.1a/ext-debug.js"></script>
        <script type="text/javascript" src="app.js"></script>
    </head>
    <body></body>
    </html>

    app.js

    Code:
    Ext.application({
        name: 'AM',
    
        appFolder: 'app',
        controllers: ['Users'],
    
        launch: function() {
            Ext.create('Ext.container.Viewport', {
                layout: 'fit',
                items: {
                    xtype: 'userList'
                }
            });
        }
    });
    app/controller/Users.js with

    Code:
    Ext.define('AM.controller.Users', {
        extend: 'Ext.app.Controller',
        views: [
            'user.List'],
    
        init: function() {
            this.control({
                'viewport > panel': {
                    render: this.onPanelRendered
                }
            });
        },
    
        onPanelRendered: function() {
            console.log('This panel was rendered');
        }
    });
    app/view/user/List.js

    Code:
    Ext.define('AM.view.user.List' ,{
        extend: 'Ext.grid.Panel',
        alias : 'widget.userlist',
    
        title : 'All Users',
    
        initComponent: function() {
            this.store = {
                fields: ['name', 'email'],
                data  : [
                    {name: 'Ed',    email: 'ed@sencha.com'},
                    {name: 'Tommy', email: 'tommy@sencha.com'}
                ]
            };
    
            this.columns = [
                {header: 'Name',  dataIndex: 'name',  flex: 1},
                {header: 'Email', dataIndex: 'email', flex: 1}
            ];
    
            this.callParent(arguments);
        }
    });

    Can anyone tell me what's wrong? Thank you.

  2. Instead of having views on the controller, try putting it on the application to see if it loads from there. The issue is the class is not being loaded.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    Instead of having views on the controller, try putting it on the application to see if it loads from there. The issue is the class is not being loaded.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default Answered

    I was able to reslve the issue, it was due to the changing of capitalization of userList. I am not sure how to mark this as 'answered'.

Tags for this Thread

Posting Permissions

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