天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 1153|回复: 0

[javascript] 获取包含元素绑定视图的数据脚本示例

[复制链接]
smart 发表于 2020-12-10 17:00:06 | 显示全部楼层 |阅读模式
  1. /**判断包含元素的是否为空**/
  2. (function () {
  3.     var rtn = "";
  4.     var doc = getCurrentDocument();
  5.     var childs2 = doc.getChilds("订单明细");
  6.     var count2 = childs2.size();
  7.     if (count2 <= 0) {
  8.         rtn = "订单明细必须填写";
  9.     }

  10.     return rtn;
  11. })()

  12. /**获取包含元素的数据**/
  13. (function () {
  14.     var user_name = "";
  15.     var doc = getCurrentDocument();
  16.     var childs = doc.getChilds("kf_mobilemeter");
  17.     println("childs ===" + childs);
  18.     if (childs != null && childs.size() > 0) {
  19.         for (var it = childs.iterator(); it.hasNext(); ) {
  20.             var subdoc = it.next();
  21.             user_name = subdoc.getItemValueAsString("user_name");
  22.         }
  23.     }
  24.     return user_name;
  25. })()
复制代码

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 09:35

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表