【发布时间】:2015-10-12 10:55:45
【问题描述】:
Modx revo 最新版本
我需要从使用表单自定义创建的特定选项卡中隐藏内容字段,我找到了这个 Ext JS 代码,但我不知道如何实现它。它是一个插件 ondocformrender 吗?我应该创建一个js文件吗?
Ext.onReady(function(){
var tabPanel = Ext.getCmp("modx-resource-tabs");
if(tabPanel!=null){
//Add my custom tab
var customTab = {
title: 'Custom',
id: 'my-custom-tab',
cls: 'modx-resource-tab',
layout: 'fit',
labelAlign: 'top',
labelSeparator: '',
bodyCssClass: 'tab-panel-wrapper main-wrapper',
autoHeight: true,
defaults: {
border: false,
msgTarget: 'under',
width: 400,
height:800
},
items: [
{
xtype: "box",
autoEl: {cn: '<div id="target_id"></div>'}
}
]
};
tabPanel.on('tabchange', function(parent,selectedTab){
if (selectedTab.id == 'my-custom-tab') {
Ext.getCmp("modx-resource-content").hide();
}
else {
Ext.getCmp("modx-resource-content").show();
}
});
tabPanel.insert(0, customTab);
tabPanel.setActiveTab(0);
tabPanel.doLayout();
}
});
【问题讨论】:
标签: javascript extjs modx modx-revolution