3 May 2011 1:29 AM #1
How to use Ext.require when using Ext.application
My app.js contains this:
Ext.application name: 'nso' autoCreateViewport: false appFolder: 'js/nso/app' controllers: ['Users'] launch: ()-> Ext.create 'nso.view.Viewport'
So this code basically simulates me creating the viewport after I get those settings back.
However, I'm getting this in Firebug:
[Ext.Loader] Synchronously loading 'nso.view.Viewport'; consider adding Ext.require('nso.view.Viewport') above Ext.onReady
EDIT: Just to clarify, I'm using coffeescript but the gist is more or less obvious, I think.
3 May 2011 1:36 AM #2
are you enabled the loader?
launch is called on Ext.onReady, this is still required to do proper rendering.
Are you sure you use the right create for the viewport?
3 May 2011 1:54 AM #3
Yes, loader is enabled and works properly. It's also the right alias to call in the create. It's not an error, just a warning that I'm getting that I want to get rid of.
3 May 2011 2:00 AM #4
compare it to the simple example which also creates the viewport. You could add a dummy viewport file as they do, but i got it without warning with autoCreateViewport: false.
Try to remove the appFolder setting.
3 May 2011 2:10 AM #5
Ext.application name: 'nso' autoCreateViewport: false appFolder: 'js/nso/app' controllers: ['Users'] launch: ()-> Ext.create('Ext.container.Viewport')
Removing the appFolder config option will only make the loader confused on where to find my files and has nothing to do with this problem whatsoever. I appreciate you trying to help but let's try to focus on the problem at hand. Thanks.
3 May 2011 2:52 AM #6
Found the right answer: there is an undocumented config option called "requires" in Ext.application that you need to use.
More details of the answer in my blog: http://bryanz.com/avoid-extloader-sy...oading-conside
By Crocuta in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 2 May 2011, 8:06 AM
By pasblin in forum Ext: DiscussionReplies: 4Last Post: 30 Apr 2011, 4:08 AM
By slmbakop in forum Ext: DiscussionReplies: 0Last Post: 9 Mar 2011, 7:13 AM
By jackiewkc in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 6 Oct 2008, 6:39 AM
By jbowman in forum Community DiscussionReplies: 0Last Post: 8 Dec 2006, 4:15 PM