1
votes

I am working on extjs 3.2.1 and I am trying to execute one extjs script from another extjs script. What I am trying to do is when a user clicks on the Database panel, the script Database.js should execute. Till now what I have done is

var tabs = new Ext.TabPanel({
        activeTab : 0,
        autoScroll: true,
            items:[
                {
              title:'Graphical-View',
              height:550,
              bodyStyle:{"background-color":"white"},
              autoScroll: true,
              items:[ GraphicalViewPanel]
              },{
                title: 'Database',
                height : 800,
                autoScroll: true,
                bodyStyle:{"background-color":"white"},
                autoLoad:{
                        url:'/resource/js/Database.js',
                        scripts : true
                }
}]      
});

But when I execute the file and click on the Database panel then the contents of Database.js is loaded in the panel instead of executing the script.

Also if I place the Graphical-view panel after the Database panel the browser gives an error --- null is null or not an object

I am not able to figure out the problem , Any help would be appreciated

Thanks.

1

1 Answers

0
votes

load your Database.js in iframe

    bodyCfg: {
        tag: 'iframe',         
        src : ""
    }

or make a php file and put your Database.js code in script tags and give the url in src

    bodyCfg: {
        tag: 'iframe',         
        src : "abc.php"
    }

for Extjs 3