In this entry I will give a tutorial on using Ext JS Namespaces.
Namespaces are a very useful functionality in extJS. You can define a namespace using:
var myNamespaceNS = new ext.Ext.NS('my.namespaces.mymodules');
Then you can add objects, or functions to the namespaces as easily as if they were normal variables:
myNamespaceNS.myObject = {title:'my title',author:'me'};
In other pieces of the code, you can get the hold of the namespace using its name or a variable.
var myNamespaceNS = new ext.Ext.NS('my.namespaces.mymodules'); alert(myNamespaceNS.myObject.title + " "+my.namespaces.mymodules.myObject.author);