开发者

Calling javascript function defined on the child window from parent window EXTJS

I have a EXTJS modal window. I would like to call a function defined on the child window from the parent window every time child window gets displayed. Is it possible to call child window function from parent window in EXTJS modal window. Thanks.

Ext.onReady(function(){
    if (! mywindow){
        // create the window on the first cl开发者_开发百科ick and reuse on subsequent clicks
        mywindow = new Ext.Window({
            title: 'My Modal Winow',
            closable:true,
            closeAction:'hide',
            width:600,
            height:350,
            border:false,
            maximizable: true,
            plain:true,
            layout: 'border',
            id : 'mywindowid',
            html  : '< div id="userframe"><iframe style="overflow:auto;width:100% height:100%;" frameborder="0" id="mrgraphiframe" src="' + customurl + '"></iframe></div >'

 ,listeners : {
         show: myfunction(){}
              }// end of listner
        });
    }        
    mywindow.show(this);
});


If you want a function to execute whenever the window is shown, just attach an event listener to it..

listeners : {
    show: functionToCall
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜