Fineui往框架添加选项卡的方法

在主页F.ready(function (){...}方法中添加js代码

// 添加示例标签页
            window.addExampleTab = function (id, url, text, icon, refreshWhenExist) {
                // 动态添加一个标签页
                // mainTabStrip: 选项卡实例
                // id: 选项卡ID
                // url: 选项卡IFrame地址 
                // text: 选项卡标题
                // icon: 选项卡图标
                // addTabCallback: 创建选项卡前的回调函数(接受tabConfig参数)
                // refreshWhenExist: 添加选项卡时,如果选项卡已经存在,是否刷新内部IFrame
                F.util.addMainTab(mainTabStrip, id, url, text, icon, null, refreshWhenExist);
            };

            // 移除选中标签页
            window.removeActiveTab = function () {
                var activeTab = mainTabStrip.getActiveTab();
                mainTabStrip.removeTab(activeTab.id);
            };

然后在需要在主框架添加选项卡的页面写js方法

var basePath = '<%= ResolveUrl("~/") %>';
 
            function openHelloFineUI(id) {
                //alert(parent.addExampleTab);
                parent.addExampleTab.apply(null, ['hello_fineui_tab', 'CafeSmilewall/Comment.aspx?id=' + id + '', '查看评论', basePath + 'res/images/filetype/vs_aspx.png', true]);
        }

在事件中调用openHelloFineUI方法即可

微笑话网站长提供

原文地址:https://www.cnblogs.com/sanjuantianshu/p/4425301.html