- 脚本如下:
- //主子表单,子表单控件的选项值根据父文档某控件的值改变(在子表单的选项脚本做控制)
- (function(){
- var value = "";
- var options = "0%;30%;50%;100%";
- var parent = getParentDocument();
- if(parent != null){
- value = parent.getItemValueAsString("完成度");
- println("完成度:"+value+"---------------");
- if(value != null) {
- if(value == "0%"){
- value = ";30%;50%;100%";
- }
- if(value == "30%"){
- value = ";0%;50%;100%";
- }
- if(value == "50%"){
- value = ";0%;30%;100%";
- }
- if(value == "100%"){
- value = ";0%;30%;50%";
- }
- if(value != "") {
- options = "";
- options = value;
- }
- }
- }
- return options;
- })()
复制代码 |