-
17 Jan 2012 3:02 PM #1
Unanswered: issues with Ext.getBody when using define
Unanswered: issues with Ext.getBody when using define
Hi, I use Ext.getBody().getViewSize().width to set width in several configs in some nested panels. This worked fine when I just did a simple create of the panel. When I put my panel in a define and use it later in a index.js I get the error Uncaught Error: [Ext.getBody] document.body does not exist at this point . The error makes sense, but I don't know how to work around it.
Code:Ext.Loader.setConfig({ enabled: true }); Ext.require('MainPage'); Ext.create('MainPage');
-
17 Jan 2012 10:31 PM #2
Put it inside a Ext.setup or Ext.application onReady callback function. Then, when your class is created, the documents body will exist.
Code:Ext.setup(function() { onReady: function() { Ext.create('MyClass'); } });Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.


Reply With Quote