anlichao 发表于 2021-2-5 15:38:08

表单中的一个下拉框,想通过查询方法动态赋值,现在值可以查到,但是无法赋值

表单中的一个下拉框,想通过查询方法动态赋值,现在值可以查到,但是无法赋值
这是在queryLoad中调用的方法:projects 是下拉框的名称
this.include("queryTableService");
// 返回项目列表
var projectBudget = new QueryTableService({ tableFlag : "projectBudget" });
projectBudget.listNext(0,999, function(json){
    var typeList = ["请选择报销项目"];
    var items = json.data;
    for(var i = 0; i < items.length; i++){
      var item = items;
      typeList.push(item.pName);
    }
    console.info("typeList",JSON.stringify(typeList))
    this.data.projects = typeList;
}.bind(this))

还试过在下拉框组件的可选值->脚本中写同样的代码,最好返回typeList,但也不行,请管理员指教~

论坛管理员 发表于 2021-2-9 10:39:20

您是想要给下拉框赋值吗,直接在下拉框中脚本赋值
https://www.o2oa.net:40020/x_file_assemble_control/jaxrs/file/e342b223-edfc-4073-9f17-dbb6756e0466/download/stream

anlichao 发表于 2021-2-9 16:39:13

我在脚本里也写过,但是那段代码查回来的数据无法赋值到 this.data.projects这个下拉框里面

论坛管理员 发表于 2021-2-18 14:51:16

您好:是在下拉框的脚本中赋值
并不是queryLoad中调用的方法中
页: [1]
查看完整版本: 表单中的一个下拉框,想通过查询方法动态赋值,现在值可以查到,但是无法赋值