10.0移动端通过单选按钮事件隐藏TAB块无法还原显示

文档中有单选按钮切换报表块,实现类似TAB切屏的效果.但我某个子屏中有tab,然后我就想结合隐藏tab页的js来实现。

按钮选不为1的选项时,确实可以隐藏,但是再按回1的时候,没有反应,并不会重新显示出来…这个有办法解决吗?或者有别的移动端子页的方案,可以支持其中一个子页的组件有tab的情况?

test.zip 模板。

单选按钮 状态改变事件,加了else也不行

if (this.value !== 1) {

// 设置所有选项卡不可见

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab1", false);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab2", false);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab3", false);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab4", false);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab5", false);

}

else{

// 设置所有选项卡可见

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab1", true);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab2", true);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab3", true);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab4", true);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab5", true);

}

FineReport 文菲克 发布于 2023-10-16 11:27 (编辑于 2023-10-16 11:32)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
snrtuemcLv8专家互助
发布于2023-10-16 11:28

需要加else

if (this.value !== 1) {

// 设置所有选项卡不可见

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab1", false);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab2", false);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab3", false);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab4", false);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab5", false);

}

else{

// 设置所有选项卡可见

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab1", true);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab2", true);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab3", true);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab4", true);

this.options.form.getWidgetByName("tabpane0").setTabVisible("tab5", true);

}

  • 文菲克 文菲克(提问者) else我也加过,也不行,大佬可以下模板试下
    2023-10-16 11:31 
  • snrtuemc snrtuemc 回复 文菲克(提问者) 知道了,判断语句问题,if (this.getValue() !== \'1\') 注意评论会银海前加斜杠,自己删除
    2023-10-16 11:38 
  • 文菲克 文菲克(提问者) 回复 snrtuemc 还真是,谢谢大佬
    2023-10-16 11:48 
  • 1关注人数
  • 143浏览人数
  • 最后回答于:2023-10-16 11:32
    请选择关闭问题的原因
    确定 取消
    返回顶部