将vars发送到加载到extjs窗口小部件中的iframe

时间:2011-12-29 08:55:29

标签: javascript iframe extjs window widget

我在Extjs中有这段代码

function showPlayer(params)
{
// params is an array of parameters sent to the iframe

    win = Ext.create('widget.window',
    {
        title: "Call player",
         width: 735,
        height: 280,
        ghost: false,
         modal: false,
        closeAction: 'hide',
        items: [
        ],

        html: '<iframe src="somepage.php?callId='+params[0]+'&lang='+params[11]+'"    style="width: 720px; height: 240px; border: none;"></iframe>'
    });

    win.on('close', function(){
       //close current tab in browser (doesn't works in FF)
       //window.close();
   });

   //show window event
    win.show(this, function(){

    })
}

我的问题是如何通过extjs窗口小部件传递从params数组到iframe contentWindow的值?有什么想法吗?

两个参数数组0和11通过url发送,其他8个没有意义通过url发送它们。

1 个答案:

答案 0 :(得分:1)

我最近不得不做类似的事情,我找不到任何ExtJs特定的功能。我决定将父文档中的参数数组命名为全局变量。然后我从iFrame中调用了parent.myParameterArray来挖掘参数。

相关问题