js主模板超链到子模板子模板的控件可见不可编辑

判断子模板的那个控件 有没有值就行了
有值就不可编辑 没值就可以编辑 


FineReport Jason.Feng 发布于 2019-11-1 11:40 (编辑于 2019-11-1 11:52)
1min目标场景问卷 立即参与
回答问题
悬赏:4 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
萌萌的呆贼Lv4初级互助
发布于2019-11-1 11:49(编辑于 2019-11-1 12:38)

控件加个初始化事件

image.png

这个控件初始化事件中:

image.png

  • Jason.Feng Jason.Feng(提问者) 其实就是判断字模板控件里面有没有之值。有值就不可以编辑,没有值就可以编辑
    2019-11-01 12:26 
  • 萌萌的呆贼 萌萌的呆贼 回复 Jason.Feng(提问者) 那你 初始化事件里面 写 if (this.getValue().length == 0) { this.setEnable(false); }
    2019-11-01 12:37 
  • Jason.Feng Jason.Feng(提问者) 回复 萌萌的呆贼 var a = _g().getWidgetByName(\"riqi\").getValue(); if(a==\"\") { this.setEnable(flase); }else if(a.length>0){ this.setEnable(true); }else { this.setEnable(flase); }
    2019-11-01 12:41 
  • Jason.Feng Jason.Feng(提问者) CustomJSError : Cannot read property \'getValue\' of undefined
    2019-11-01 12:44 
最佳回答
0
axingLv6专家互助
发布于2019-11-1 11:49

不知你的这个参数a是参数名还是参数值,做类似下面的判断

image.png

  • 3关注人数
  • 485浏览人数
  • 最后回答于:2019-11-1 12:38
    请选择关闭问题的原因
    确定 取消
    返回顶部