1. #1
    Sencha User
    Join Date
    Feb 2008
    Location
    @bryanzarzuela
    Posts
    55
    Vote Rating
    0
    bzarzuela is on a distinguished road

      0  

    Question How to use Ext.require when using Ext.application

    How to use Ext.require when using Ext.application


    My app.js contains this:

    Code:
    Ext.application
      name: 'nso'
      
      autoCreateViewport: false
      
      appFolder: 'js/nso/app'
      
      controllers: ['Users']
      
      launch: ()->
        Ext.create 'nso.view.Viewport'
    The reason I don't auto create the viewport is because I want to check first with an Ajax call about a couple of settings that should allow me to the configure it properly.

    So this code basically simulates me creating the viewport after I get those settings back.

    However, I'm getting this in Firebug:

    Code:
    [Ext.Loader] Synchronously loading 'nso.view.Viewport'; consider adding Ext.require('nso.view.Viewport') above Ext.onReady
    Is Ext.onReady still applicable if you're using Ext.application?

    EDIT: Just to clarify, I'm using coffeescript but the gist is more or less obvious, I think.

  2. #2
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    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?
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Location
    @bryanzarzuela
    Posts
    55
    Vote Rating
    0
    bzarzuela is on a distinguished road

      0  

    Default


    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.

  4. #4
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    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.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  5. #5
    Sencha User
    Join Date
    Feb 2008
    Location
    @bryanzarzuela
    Posts
    55
    Vote Rating
    0
    bzarzuela is on a distinguished road

      0  

    Default


    Quote Originally Posted by steffenk View Post
    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.
    Even if I try:

    Code:
    Ext.application
      name: 'nso'
      
      autoCreateViewport: false
      
      appFolder: 'js/nso/app'
      
      controllers: ['Users']
      
      launch: ()->
        Ext.create('Ext.container.Viewport')
    I still get the same warning.

    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.

  6. #6
    Sencha User
    Join Date
    Feb 2008
    Location
    @bryanzarzuela
    Posts
    55
    Vote Rating
    0
    bzarzuela is on a distinguished road

      0  

    Default


    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

Similar Threads

  1. Ext.require is not a function
    By Crocuta in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 2 May 2011, 8:06 AM
  2. Ext 4 and the Ext.require
    By pasblin in forum Ext: Discussion
    Replies: 4
    Last Post: 30 Apr 2011, 4:08 AM
  3. require on Ext JS 4
    By slmbakop in forum Ext: Discussion
    Replies: 0
    Last Post: 9 Mar 2011, 7:13 AM
  4. Application running on Apache and require connection to a MSSQL database
    By jackiewkc in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 6 Oct 2008, 6:39 AM
  5. looks like the next release will require yui 0.12
    By jbowman in forum Community Discussion
    Replies: 0
    Last Post: 8 Dec 2006, 4:15 PM

Thread Participants: 1