本帖最后由 hmh01cn 于 2024-3-7 13:18 编辑
我在表单上引入了一个子表单。上面的代码是写在elselect的可选值脚本里面的。
然后表单上点击按钮,就会以弹窗的形式将子表单呈现出来。
以下是按钮的事件代码:
[JavaScript] 纯文本查看 复制代码 this.form.get("XYBLC").reload();
if (workname == "申请" && this.data.JSR_FGLD != "NULL"){
//打开审批界面
var contentNode = this.form.get("div_TJ").node.show();
var node = contentNode.getFirst();
var _self = this;
this.form.dataGridDlg = o2.DL.open({
"title": "选择审批流程",
"width": "650",
"height": "400",
"overflow": "auto",
"mask": true,
"content": node,
"isClose":false,
"isTitle": false,
"container":this.form.node(),
"positionNode": this.form.getApp().content,
"onQueryClose": function(){
node.inject(contentNode);
contentNode.hide();
}.bind(this),
"onPostLoad": function(){
},
"onQueryLoad": function(){
this.form.get("XYBLC").reload();
this.form.get("txt_title").setData(this.GET_Title(data));
}.bind(this),
"buttonList": [
{
"text": "提交",
"action": function(){
if (this.form.get("XYBLC").getData() == ""){
alert("还未选择下一步流程");
return;
}
if (this.form.get("XYBLC").getData().includes("退回") == true && this.form.get("SPYJ").getData() == ""){
alert("退回流程必须填写退回原因");
return;
}
var title = this.form.get("txt_title").getData();
_self.form.get("subject").setData(title);
this.form.process({
"routeName": this.form.get("XYBLC").getData(),
"opinion": this.form.get("SPYJ").getData()
});
}.bind(this)
},
{
"text": "关闭",
"action": function(){
this.form.dataGridDlg.close();
}.bind(this)
}]
})
}
代码里面有两个reload,不是同时存在的。只是表达,我在这两个地方都试过用reload、resetOption。
结果就是文字变了,但是选项前面的圆点变成了">"
我也做了测试,就在表单上放一个elradio,如果通过脚本获取选项return ["a|a", "b|b"];
然后通过reload或者resetOption刷新一下控件。
都会变成">"
|