1. #1
    Ext User
    Join Date
    Jan 2011
    Posts
    1
    Vote Rating
    0
    AlThar is on a distinguished road

      0  

    Smile Scripts dont work on tab content page

    Scripts dont work on tab content page


    Good day.
    I got tabPanel on my page.
    What i want to do is - load content to each tab from another page. For examplae i got tabMain.html page and tabPanel on it. In this tab there is a tab "data". I want this tab to load content from another page (let`s say data.html)

    I got code on tabMain.html
    Code:
    Ext.onReady(function()
                {
                    var tabs = new Ext.TabPanel({
                        region: 'center',
                        margins:'3 3 3 0',
                        activeTab: 0,
                        defaults:{autoScroll:true},
                        flex:1,
                        items:[{
                                title: 'Statistics',
                                autoLoad:{url:getURLForPage("statistics.html")},
                                listeners:{
                                    activate : function(panel){
                                        panel.getUpdater().refresh();
                                    }}
                            },{
                                title: 'Data',
                                autoLoad:{url:getURLForPage("data.html")},
                                listeners:{
                                    activate : function(panel){
                                        panel.getUpdater().refresh();
                                        loadDataPage();
                                    }}
                            },{
                                title: 'Reports',
                                autoLoad:{url:getURLForPage("reports.html")},
                                listeners:{
                                    activate : function(panel){
                                        panel.getUpdater().refresh();
                                    }}
                            }]
                    });
    
                    var nav = new Ext.Panel({
                        title: 'Navigation',
                        region: 'west',
                        split: true,
                        width: 200,
                        collapsible: true,
                        margins:'3 0 3 3',
                        cmargins:'3 3 3 3'
                    });
                    var bot = new Ext.Panel({
                        title: 'Info',
                        region: 'south',
                        split: true,
                        height:200,
                        collapsible: true,
                        margins:'3 0 3 3',
                        cmargins:'3 3 3 3'
                    });
    
                    var pan = new Ext.Panel({
                        title: 'Zingaya admin',
                        layout:'vbox',
                        layoutConfig: {
                            align : 'stretch',
                            pack  : 'start'
                        },
                        closable:false,
                        height:window.innerHeight,
                        plain:true,
                        layout: 'border',
                        deferredRender:false,
                        activeTab:0,
                        items: [nav, tabs,bot]
                    });
                    pan.render('main_form');
                });
    On my data.html page i got Ext script too.
    Code:
    Ext.onReady(function()            {
                    alert("data loaded");
                };
    and some static HTML content.

    When i select the "data" tab i see my content, but dont see my alert... It seams like javascript just dont execute when page content is loaded...

    I even tried to write simple function in data.html page and call it when my tab already downloaded content page, but is says that my function in not specified...

    Please tell me, how can i make my content page`s scripts work on caller page.

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    77
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      1  

    Default


    try setting scripts : true on your autoLoader configs.

Similar Threads

  1. Changing tab content without redrawing page?
    By RodS1967 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 19 Apr 2010, 7:47 AM
  2. why the content of old tab still display on page when switch to new tab
    By mychirs in forum Ext 2.x: Help & Discussion
    Replies: 9
    Last Post: 12 May 2009, 5:50 AM
  3. why the content of old tab still display on page when switch to new tab
    By mychirs in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 10 May 2009, 8:55 PM
  4. nested tabs (tab inside another tab) dont layout properly
    By robiechahine in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 17 Nov 2007, 6:50 PM
  5. >1 iFrame: Dont want to re-reload all scripts!
    By Choleriker in forum Community Discussion
    Replies: 29
    Last Post: 4 May 2007, 5:08 AM

Thread Participants: 1