Results 1 to 3 of 3

Thread: First App (Override Error)

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    5

    Default Answered: First App (Override Error)

    Hi!

    I'm trying to create mi first application with Ext, (after a lot of reading) but i can't get this error away:


    app.js
    Code:
    Ext.Loader.setConfig({ 
        enabled: true, 
         paths   : {  
            Myapp  : "application/assets/javascript/application"  
        }  
    }); 
        
    Ext.application({ 
        name: 'myapp',             
        launch:function(){   
            this.viewport = Ext.create("Myapp.AppLayout") 
        } 
    });
    AppLayout.js
    Code:
    renderViewport = function() {    Ext.create('Ext.Viewport',{
            html: 'asasas' 
        });
    }
        
    Ext.define("Progo.Layout", renderViewport());
    Everything renders fine, but this message appears into my javascript console:

    TypeError: Cannot read property 'override' of undefined
    i hope somebody knows!, thanks!

  2. Couple things...

    1. You don't need a path for Myapp, Ext.application will add a path in there for you.
    2. The name of your Ext.application should be 'Myapp' not 'myapp'
    3. Ext.define isn't being used correctly...


    Code:
    Ext.define('Myapp.AppLayout', {
        extend : 'Ext.container.Viewport',
        xtype : 'myapp-applayout',
        ....
    });
    Also, your naming convention is off. Your views should be in the Myapp.view namespace, controllers be in Myapp.controller, models in Myapp.model, and stores in Myapp.store and your folder structure should follow this...


    app/
    --controller/
    --model/
    --store/
    --view/

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Couple things...

    1. You don't need a path for Myapp, Ext.application will add a path in there for you.
    2. The name of your Ext.application should be 'Myapp' not 'myapp'
    3. Ext.define isn't being used correctly...


    Code:
    Ext.define('Myapp.AppLayout', {
        extend : 'Ext.container.Viewport',
        xtype : 'myapp-applayout',
        ....
    });
    Also, your naming convention is off. Your views should be in the Myapp.view namespace, controllers be in Myapp.controller, models in Myapp.model, and stores in Myapp.store and your folder structure should follow this...


    app/
    --controller/
    --model/
    --store/
    --view/
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    5

    Default

    Thanks mitchellsimoens,

    Im going to use the Ext convention then and back to read all over again.

Posting Permissions

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