Results 1 to 2 of 2

Thread: Sandboxed ExtJS 4, Ext4.Loader and Ext4.onReady

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    33
    Vote Rating
    0
      0  

    Default Sandboxed ExtJS 4, Ext4.Loader and Ext4.onReady

    Hi,

    I spent good while to figure out problems with our code and found out following works:

    HTML Code:
    <script type="text/javascript" scr="libs/ext-4.1.2a/builds/ext-all-sandbox.js"></script>
    <script type="text/javascript">
        Ext4.onReady(function() {
            alert("This works!");
        });
    
        Ext4.Loader({ enabled: true });
    </script>
    But following doesn't file onReady for some reason:

    HTML Code:
    <script type="text/javascript" scr="libs/ext-4.1.2a/builds/ext-all-sandbox.js"></script>
    <script type="text/javascript">
        Ext4.Loader({enabled: true});
    
        Ext4.onReady(function() {
            alert("This doesn't work!");
        });
    </script>
    Is there reason that Ext4.Loader usage causes onReady not to fire? Is the only solution to switch to use Ext4.require after using loader?

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Vote Rating
    1381
      0  

    Default

    onReady should only fire when the document body executes the load and when all classes that are being loaded are loaded. The sandbox mode should only be used as a transition tool also not for production.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

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