加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

dojo的TabContainer中增加的ContentPane如果是closable,如何在

发布时间:2020-12-16 21:25:24 所属栏目:百科 来源:网络整理
导读:主要思路是新建 TabContainer的扩展类,重载其 closeChild属性,使得其在关闭子容器时,不调用该子容器的 destroyRecursive方法。 define([ "dojo/_base/declare","dijit/layout/TabContainer" ],function(declare,TabContainer) { return declare("comm.com

主要思路是新建TabContainer的扩展类,重载其closeChild属性,使得其在关闭子容器时,不调用该子容器的destroyRecursive方法。

define([ "dojo/_base/declare","dijit/layout/TabContainer"

],function(declare,TabContainer) {
return declare("comm.comm.ExTabContainer",TabContainer,{
closeChildAction:"destroy",
closeChild: function(/*dijit/_WidgetBase*/ page){
// summary:
// Callback when user clicks the [X] to remove a page.
// If onClose() returns true then remove and destroy the child.
// tags:
// private
var remove = page.onClose && page.onClose(this,page);
if(remove){
this.removeChild(page);
if (this.closeChildAction=="destroy"){
// makes sure we can clean up executeScripts in ContentPane onUnLoad
page.destroyRecursive();
}
}
}
});

});
然后创建TabContainer的方法如下:
var tc=new ExTabContainer({
style : "height: 100%; width: 100%;",sans-serif; font-size:13px"> isLayoutContainer : true,sans-serif; font-size:13px"> region : 'center',sans-serif; font-size:13px"> closeChildAction:"hide"
});

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读