1. #1
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    315
    Vote Rating
    0
    josh803316 is on a distinguished road

      0  

    Default autoLoad and external javascript

    autoLoad and external javascript


    If I'm attempting to autoLoad an external html file, that contains javascript, inside a tab panel, currently nothing seems to happen from a scripting perspective. I don't get any errors but no script action takes place(no graph is displayed)....I was wondering if there was some way that I needed to load external JS (non ext related) or a specific format for the html file so that the script inside the html file gets executed.

    Code:
    items: new Ext.TabPanel({
                                id: 'main-tab-panel',
                                activeTab:0,
                                tabPosition:'top',
                                defaults:{autoScroll:true},
                                items:[{
                                    ......
                                    id: 'graph_tab',
                                    title: 'graph Tab',
                                    height: '1000px',
                                    width: '1000px',
                                    autoScroll:true,
                                    autoLoad: 'TimePlot.html',
                                    defaults:{autoScroll:true},
                                }]
                        })

  2. #2
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Start with scripts:true in you autoLoad config.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  3. #3
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    315
    Vote Rating
    0
    josh803316 is on a distinguished road

      0  

    Default


    I added scripts: true to my config but don't see any change. Firebug shows the response as containing the script elements but doesn't show that any scripts were loaded. I see a brief loading indicator and then the panel is blank.

    Code:
                                    .............
                                    autoScroll:true,
                                    autoLoad: {url: 'TimePlot.html', scripts: true},
                                    defaults:{autoScroll:true},
    Timeplot.html
    Code:
    <script type="text/javascript">
                            /**
                             * Wait till dom's finished loading.
                             */
                            document.observe('dom:loaded', function(){
                                    /**
                                     * Fill series d1 and d2.
                                     */
                                    var d1 = [];
                                    var d2 = [];
                                    var d3 = [];
                                for(var i = 0; i < 15; i += 0.5){
                                    d1.push([i, i + Math.sin(i+Math.PI)]);
                                            d2.push([i, i]);
                                            d3.push([i, 15-Math.cos(i)]);
                                    }
                            
                                    /**
                                     * This function prepend each label with 'y = '.
                                     */
                                    function myLabelFunc(label){
                                            return 'y = ' + label;
                                    }
                            
                                    /**
                                     * Draw the graph.
                                     */
                                var f = Flotr.draw(
                                            $('container1'), [ 
                                                    {data:d1, track:true, label:'x + sin(x+&pi;)'},
                                                    {data:d2, track:true, label:'x'},
                                                    {data:d3, track:true, label:'15 - cos(x)'},         
                                            ],{
                                                    legend:{
                                                            position: 'se', // => position the legend 'south-east'.
                                                            labelFormatter: myLabelFunc, // => format the labels.
                                                            backgroundColor: '#D2E8FF' // => a light blue background color.
                                                    }
                                            }
                                    );
                            });
                    </script>
    
      <div id="container1" style="width:600px;height:300px;"></div>

  4. #4
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Sorry, try it with loadScripts:true in you autoLoad config.

    See Ext. Element.update method in API DOcs for help.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  5. #5
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    315
    Vote Rating
    0
    josh803316 is on a distinguished road

      0  

    Default


    It looks like you were right with your first guess, although I'm not seeing any script execution attempt even when I use the scripts or loadScripts parameter.

    (From the API docs)
    scripts : Boolean

    If true any <script> tags embedded in the response text will be extracted and executed. If this option is specified, the callback will be called after the execution of the scripts.

  6. #6
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    There is no need for this:
    document.observe('dom:loaded', function(){
    the document has already been loaded and is ready, you are just adding to it. Remove that wrapper around your code since it is probably never firing, and move the code below the markup.

  7. #7
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    315
    Vote Rating
    0
    josh803316 is on a distinguished road

      0  

    Default


    Thanks for the help. I was able to get it working with your suggestions.

    I had to set scripts: true in my autoLoad, and I had to move the markup before the script tags in my html.

  8. #8
    Ext User
    Join Date
    Jul 2010
    Posts
    1
    Vote Rating
    0
    bhadra is on a distinguished road

      0  

    Default


    Quote Originally Posted by josh803316 View Post
    Thanks for the help. I was able to get it working with your suggestions.

    I had to set scripts: true in my autoLoad, and I had to move the markup before the script tags in my html.
    what you mean by markup ? is it div tab ?

  9. #9
    Sencha User
    Join Date
    May 2010
    Location
    Earth
    Posts
    5
    Vote Rating
    0
    topgun743 is on a distinguished road

      0  

    Default Problem accessing HTML button (type=Submit) that exists in autoLoaded Page.

    Problem accessing HTML button (type=Submit) that exists in autoLoaded Page.


    Hi,

    I have problem accessing an HTML button (type=Submit) which exists in autoLoaded Page i.e it loads on a panel using autoLoad {url:myurl} config option. The Panel is being created on an ExtJS popup window that is created on click of a link.

    I cannot access it from the launching code, I mean the code which creates the ExtJS window. It is null or undefined when I try to use it in my launching code. I am using Ext.get('myButtonName') to access it.

    Please help me as I am stuck with it.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi