schoterson
11 Aug 2008, 2:28 PM
In ext-2.1 and 1.1.1 for that matter I had no problem doing this
Ext.EventManager.addListener(window, 'load',Intranet.framework.Core.initializePage, Intranet.framework.Core);
Intranet.framework.Core.initializePage = function() {
console.log("initing page methods");
// half dozen calls to methods, followed by the quicktips init.
Ext.QuickTips.init();
}
however in ext-2.2 this seems to cause an issue, specifically:
tip has no property
tip.register.apply(tip, arguments);
After editing ext-all-debug to add in some alerts to the Ext.QuickTips.init it seems to me that the check for onReady causes an issue.
I would expect to see the first warning about tip not being defined and that is it, since my call to init is after the windows load event. however I see the 2nd warning and then the error message. If I see the 2nd warning I'd expect to see the 1st one again since its a recursive call to the init function, but I never do. Is the return line screwing this up?
init : function(autoRender){
if(!tip){
console.warn("initing quicktips and tip isn't defined");
if(!Ext.isReady){
console.warn("initiing quicktips document is NOT ready");
Ext.onReady(function(){
console.log("re-initing quicktips");
Ext.QuickTips.init(autoRender);
});
return;
}
tip = new Ext.QuickTip({elements:'header,body'});
if(autoRender !== false){
tip.render(Ext.getBody());
}
}
}
My solution was to move the call to the Ext.QuickTips.init() method out of my initializePage method so its not called via the onload event, which is probably the better thing to do anyways, so now I guess I'm just curious.
Ext.EventManager.addListener(window, 'load',Intranet.framework.Core.initializePage, Intranet.framework.Core);
Intranet.framework.Core.initializePage = function() {
console.log("initing page methods");
// half dozen calls to methods, followed by the quicktips init.
Ext.QuickTips.init();
}
however in ext-2.2 this seems to cause an issue, specifically:
tip has no property
tip.register.apply(tip, arguments);
After editing ext-all-debug to add in some alerts to the Ext.QuickTips.init it seems to me that the check for onReady causes an issue.
I would expect to see the first warning about tip not being defined and that is it, since my call to init is after the windows load event. however I see the 2nd warning and then the error message. If I see the 2nd warning I'd expect to see the 1st one again since its a recursive call to the init function, but I never do. Is the return line screwing this up?
init : function(autoRender){
if(!tip){
console.warn("initing quicktips and tip isn't defined");
if(!Ext.isReady){
console.warn("initiing quicktips document is NOT ready");
Ext.onReady(function(){
console.log("re-initing quicktips");
Ext.QuickTips.init(autoRender);
});
return;
}
tip = new Ext.QuickTip({elements:'header,body'});
if(autoRender !== false){
tip.render(Ext.getBody());
}
}
}
My solution was to move the call to the Ext.QuickTips.init() method out of my initializePage method so its not called via the onload event, which is probably the better thing to do anyways, so now I guess I'm just curious.