Results 1 to 7 of 7

Thread: How to aviod warning "synchronized loading"

  1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    36
    Answers
    1

    Default How to aviod warning "synchronized loading"

    in my controler I have init function:

    init : function() {

    Ext.create("SimpleWeb.view.person.Search");
    Ext.create("SimpleWeb.view.person.Edit");
    Ext.create("SimpleWeb.view.person.Add");
    Ext.create("SimpleWeb.view.person.Delete");
    Ext.create("SimpleWeb.view.contact.Add");
    Ext.create("SimpleWeb.view.contact.Edit");
    Ext.create("SimpleWeb.view.contact.Delete");
    ...

    this cause warining: Synchronously loading 'SimpleWeb.view.contact.Add'

    How I can avoid this warning ? I need at start application inicialized all window and then just call them: Ext.getCmp("PersonSearch").show();

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258
    Answers
    759

    Default

    To prevent the warning, you need to use either:

    a) requires (on other classes)
    b) If you're using MVC, views on the app/controller.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User
    Join Date
    May 2013
    Posts
    36
    Answers
    1

    Default

    I already try it but when I use:
    Code:
     requires : [ 'SimpleWeb.view.person.Search' ]
    in my main panel instead of:
    Code:
    //Ext.create("SimpleWeb.view.person.Search");
    in controler then
    Code:
    Ext.getCmp("PersonSearch")
    return undefined. Same with view in app.js

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258
    Answers
    759

    Default

    When you use Ext.create(), it will go and load the JS file if it's not yet loaded. By putting it in the requires, you're saying that you'll need it at some point.

    You still need to use Ext.create('MyClass') or new MyClass(), even if you've required it.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  5. #5
    Sencha User
    Join Date
    May 2013
    Posts
    36
    Answers
    1

    Default

    ok thx that you deny your first answer now please answer to my question: How should I inicialized all components at startup without these warning

  6. #6
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258
    Answers
    759

    Default

    The answer is the same. You need to require() them before you use them to prevent the warning.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  7. #7
    Sencha User
    Join Date
    May 2013
    Posts
    36
    Answers
    1

    Default

    hm ok so I need to add requied and warning dissapear. Now is loading application faster ?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •