I have created showNfn function in namespace "ui.utp.common".
Code:
Ext.namespace('ui','ui.utp','ui.utp.common');
Ext.QuickTips.init();
ui.utp.common = function(){
...
...
// On clicking the help link on the header the help window will be shown
Ext.get("help").on('click', function(){
helpWindow.show();
});
// public space
return {
test:"check this",
// public methods
/*
* This function displays the notification message near the header.
* Also there is an option to close this notification. The layout
* adjusts automatically.
*/
var showNfn = function(){
Ext.Ajax.request({
url: '/data/json/msg.json',
success: function(response,opts){
var obj = Ext.decode(response.responseText);
if(obj.succes){
Ext.getCmp("mainHeader").setHeight(100);
var nfnContent='<div id="mainNfn"><div style="height:20px;"><div style="float:left;margin:3px 0 0 24px;" id="nfnTxt">'+obj.msg+'</div><div class="cancelNfn"></div></div></div>';
Ext.getCmp("notification").update(nfnContent);
Ext.getCmp("mainLayout").doLayout(true,true);
Ext.select('.cancelNfn').on('click', function(){
//Hide Notification and reset the height
Ext.getCmp("notification").hide();
Ext.getCmp("mainHeader").setHeight(74);
Ext.getCmp("mainLayout").doLayout(true,true);
})
Ext.get('release').on('click', function(){
//Call Release notes Window
alert("Release notes... TBD")
})
}
}
});
} //End of showNfn();
}
}();
I checked firebug DOM viewer, there it is showing "undefined undefined", if I double click on that, then it is showing the details of the namespace we have defined. I thought i have defined wrongly and pasted the example from one of the ExtJS namespace tutorial example, the behavior is the same.
After going thru tutorials, I am totally confused between the terms package, class, object, namespace in ExtJS. Anyway i am not going to give up till I understand this completely.