Danilo M.
Danilo M.

Reputation: 1592

JavaScript Name Space

I wanna implement the Name Space concept in my JavaScript code, I am using ExtJS, but I don't know where to start, anyone could help me? The site example is very short.

Upvotes: 0

Views: 184

Answers (2)

dbrin
dbrin

Reputation: 15673

Actually in ExtJS4 the App name is your name space. So for example if you define your app this way:

Ext.application({
    name: 'MyApp',
    appFolder: 'app', 
    autoCreateViewport: true,
    controllers: [
        'MyController'
        ],
    launch: function() {
        console.log('hello');

        // This is fired as soon as the page is ready
    }
});​

then all of your components you define need to be namespaced with MyApp. So a controller becomes MyApp.controller.MyController and a view becomes MyApp.view.InboxGrid

Upvotes: 1

Related Questions