1. #1
    Sencha User
    Join Date
    Jun 2007
    Posts
    33
    Vote Rating
    0
    HSomb is on a distinguished road

      0  

    Question Dynamic loading

    Dynamic loading


    Hi guys,

    I've recently been researching about building large extjs apps.
    After reading the forums and doing a little research of mine I came into a problem.
    For the sake of this question I defined an "App" namespace.

    So I've this one file with the following code:

    PHP Code:
    App.ModulesManager Ext.extend(Ext.util.Observable,{
        
    test: function() {
            
    alert("test");    
        }    
    }); 
    App.modulesManager = new  App.ModulesManager(); 
    This file is called ModulesManager.js

    I have another file with some code and I would like to have the following

    PHP Code:
    init: function() {    
            var 
    ViewPort =  new Ext.Viewport({
                
    layout:'border',
                
    border:false,
                
    items:[header,this.tabPanel,this.barraApps]
            });
           
                   
    App.modulesManager.test();
        } 
    So I know I can do it if I load the ModulesManager.js file when the page loads using <script>. What I would like to do would be to load different js files (with the objects) as they would be needed (since this is a fairly large app). This would also allow to invoke any object from any other (a bit like automatic class loading in PHP).
    Is it possible? Is it straight forward? Sorry but I have a severe lack of experience in this field of ExtJS.

    Thanks for any help

    Hugo

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    You may want to search $JIT and JScout, those are two extensions I know of in these forums that provide some capability to remoteload like that.

    You could also look at leveraging ComponentManager's onAvailable event. Or, create your own ModuleManager perhaps, and have it check if the module is loaded and if not load it.

    There was another thread just today discussing how to do this via errors/exceptions if the class is not loaded to catch the error and presumably load the necessary resources.

  3. #3
    Sencha User
    Join Date
    Jun 2007
    Posts
    33
    Vote Rating
    0
    HSomb is on a distinguished road

      0  

    Default


    Thx mjlecomte, going to do some digging on those points!

Thread Participants: 1