dojo的TabContainer添加ContentPane假设closable,怎么不闭幕后予以销毁ContentPane
2015-09-16 14:39
246 查看
其主要思想是新的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"
});
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"
});
相关文章推荐
- 友好的 ContainerView & AutoLayout 资料推荐
- 人工智能是什么?
- 文件描述符标志和文件状态标志区别 http://blog.csdn.net/hittata/article/details/8665892
- 【英语】Bingo口语笔记(85) - ain,ane读法
- Saiku操作界面的简化
- Saiku OLAP
- 友好的 ContainerView & AutoLayout 资料推荐
- AIX系统下RAC故障之一--CRS服务启动失败(coredump)
- 如何用u盘装系统?UltraISO软件安装win7系统图文教程
- cts/gts中一些fail项解决办法总结
- THE DRUNK JAILER - 1218
- leetcode 070 Climbing Stairs(难易度:Easy)
- hdu 1021 Fibonacci Again
- Failed to install weixin11.apk on device 'emulator-5554': timeout
- The Beauty of Capturing Faces: Rating the Quality of Digital Portraits
- WIN7下运行hadoop程序报:Failed to locate the winutils binary in the hadoop binary path
- myibtais配置数据源属性生效优先级
- LeetCode Contains Duplicate
- 【投稿】友好的 ContainerView & AutoLayout 资料推荐
- LeetCode-Contains Duplicate II