码迷,mamicode.com
首页 > 其他好文 > 详细

dojo的TabContainer添加ContentPane假设closable,怎么不闭幕后予以销毁ContentPane

时间:2015-09-16 15:52:14      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

其主要思想是新的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%;", 
  isLayoutContainer : true, 
  region : ‘center‘, 
  closeChildAction:"hide" 
}); 

版权声明:本文博主原创文章,博客,未经同意不得转载。

dojo的TabContainer添加ContentPane假设closable,怎么不闭幕后予以销毁ContentPane

标签:

原文地址:http://www.cnblogs.com/mengfanrong/p/4813296.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!