Results 1 to 2 of 2

Thread: namespace is undefined

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Location
    Bangalore, India
    Posts
    17

    Default namespace is undefined

    Hi All,
    I am new to Ext JS 4 and creating my first app. I am getting an error "namespace is undefined" thru firebug. Please help me out.
    My application has 3 section header ,content and footer. Problem is coming with the footer class?:

    Header:

    Code:
    Ext.define('Ponderosa.view.Header',{
        extend:'Ext.Component',
        alias:'widget.header',
                autoEl : {
                    tag : 'div',
                    html : '<H1>Header</H1>'
                }
                });
    Footer:
    Code:
    Ext.define('Ponderosa.view.Footer',{
        extend:'Ext.Component',
        alias:'widget.footer',
                autoEl : {
                    tag : 'div',
                    html : '<H1>Footer</H1>'
                }});
    app:

    Code:
    Ext.application({
        name :'Ponderosa',
        appFolder : 'app',
        launch : function(){
            Ext.create('Ext.container.Viewport',{
            renderTo:Ext.getBody(),
            layout : {
                    type : 'border' // Using border layout
                },
                defaults : {
                    split : false
                },
            items:[
                {
                    xtype:'header',
                    height:50,
                    region:'north'
                },
                {
                    xtype:'tabpanel',
                    region:'center',
                    items:[
                    {
                        title:'tab 1'
                    }
                    ]
                },
                {
                    xtype:'footer',
                    height:50,
                    region: 'south'
                    
                }
            ]
            });
        }
    });
    Last edited by skirtle; 6 Jan 2012 at 2:30 AM. Reason: Added CODE tags

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    Please use [CODE] tags when posting code.

    Are you using the dynamic loader or are you just including files using script tags? Either way, are you definitely including the relevant files? Take a look through Firebug's Net tab, see if the files are being loaded. With the dynamic loader you'll need to require the classes, if you're not using the loader then just make sure you have the correct script tags listed in your HTML.

    You should probably add the views config, that'll implicitly require the relevant files:

    Code:
    Ext.application({
        name :'Ponderosa',
        appFolder : 'app',
        views: ['Footer', 'Header'],
    
        ...
    On a side note, you shouldn't have a renderTo on a viewport. You may also be interested in the setting autoCreateViewport:

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

Posting Permissions

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