1. #1
    Sencha User
    Join Date
    Jan 2008
    Location
    Levittown, PA
    Posts
    316
    Answers
    2
    Vote Rating
    2
    mjhaston is on a distinguished road

      0  

    Default Unanswered: Add individual tab code outside main .js - without MVC

    Unanswered: Add individual tab code outside main .js - without MVC


    I have a project I've been working on that started out as an entirely dynamic adhoc system. Reports/files were listed in a west nav pane and would add tabs to the center. Each tab contained a dynamic grid. All of this code is in one main.js script. I would just pass the configs to the dynamic grid and it handled any file I threw at it.

    Now I'm finding that the users actually want more of a custom report per page, especially since they'll want grouping and summaries. I can't figure out how to add that to my dynamic grid, so I figure my best bet is to write a .js per report tab.

    How can I keep my main.js with the basic viewport. The nav is loaded via JSON, so reports will show up when available. I need to have other report1.js, report2.js, report3.js, etc files that I can drop into my application folder and then have the main.js use them when the user clicks their report. I don't want to load all of these reports, just have them available to go.

    Does that make sense? All help appreciated.

  2. #2
    Sencha User
    Join Date
    Jan 2008
    Location
    Levittown, PA
    Posts
    316
    Answers
    2
    Vote Rating
    2
    mjhaston is on a distinguished road

      0  

    Default


    I'm checking this post out. Looks like I can load the script. Not sure how much I'm going to muck this all up.

    Code:
    var url = "myfile.js";
    var onload = function () {
       // do something onload
    }
    var onerror = function () {
       // do something onerror
    }
    var scope = this;
    Ext.Loader.injectScriptElement(url, onload, onerror, scope);