ExtJS将IFrame添加到选项卡

时间:2018-10-04 19:30:05

标签: javascript asp.net-mvc extjs

我已经在互联网上搜索了解决方案,但是没有找到解决方案。我希望能够将请求发送到外部网页,并将响应HTML放入IFrame,以便可以将其显示在选项卡面板上的选项卡中。我当前的代码如下:

onRpBtnClick: function (record) {
    var tabPanel = window.parent.App.Tabs;
    var tabId = "Rp_" + record.data.Id;
    var tab = tabPanel.getComponent(tabId);
    if (!tab) {
        tab = tabPanel.add({
            id: tabId,
            closable: true,
            xtype: "ux.iframe",
            title: record.data.Description + " - RP",
            src: record.data.RP.Value
        });

        tabPanel.doLayout();
    }

    tabPanel.setActiveTab(tab);
}

但是,这会导致错误:

VM534:3 Uncaught TypeError: c is not a constructor
at eval (eval at getInstantiator (ext.axd?v=4.1.0:19), <anonymous>:3:8)
at Object.create (ext.axd?v=4.1.0:19)
at Object.widget (ext.axd?v=4.1.0:19)
at F.create (ext.axd?v=4.1.0:19)
at F.lookupComponent (ext.axd?v=4.1.0:19)
at F.prepareItems (ext.axd?v=4.1.0:19)
at F.add (ext.axd?v=4.1.0:19)
at Object.onRpBtnClick (MyJsFile.js:56)
at g.fn (ext.axd?7c77253627eb49df98537c540a08ec11:2)
at F.fire (ext.axd?v=4.1.0:19)

0 个答案:

没有答案