-
4 Oct 2012 1:22 AM #1
Answered: When to use (or not) renderTo: document.body
Answered: When to use (or not) renderTo: document.body
I am confused (nothing new there then).
When the following code is in my Ext.applications's launch() override, the form displays correctly
However, when it is in a controller's code, it does not, and no error is reported:Code:Ext.create('Pegfect.view.profile.LoginForm', { renderTo: document.body });
Am I breaking some unwritten Ext JS law here?
controller snippet:
Or is it more to do with pipeline (sometimes i feel im forever stuck in some asp.net web forms style init, load, render order-of-things-horror-nightmare).Code:init: function () { this.onApplicationLoaded(); } onApplicationLoaded : function () { Ext.create('Pegfect.view.profile.LoginForm', { renderTo: document.body }); }
-
Best Answer Posted by skirtle
All sorts of things that could be going wrong here. Try this:
This will confirm two things: whether the method is being called and whether or not document.body exists at that point.Code:onApplicationLoaded : function () { console.log(document.body); Ext.create('Pegfect.view.profile.LoginForm', { renderTo: document.body }); }
-
4 Oct 2012 2:15 AM #2
All sorts of things that could be going wrong here. Try this:
This will confirm two things: whether the method is being called and whether or not document.body exists at that point.Code:onApplicationLoaded : function () { console.log(document.body); Ext.create('Pegfect.view.profile.LoginForm', { renderTo: document.body }); }


Reply With Quote