参考应用市场的,固定资产管理,数据表格有单选择...
参考应用市场的,固定资产管理,数据表格有单选择...
如何多选后导入多行数据到表单里面?
就是说双击后弹出视图内容多选后选择的多行导入到表单内?
本帖最后由 论坛管理员 于 2023-2-10 15:56 编辑
您看一下代码,代码上有个参数是否单选的,改成true,就是多选了
值改一个true虽然可以多选但是导入数据行数还是固定的,输入框当赋值对应太死板
是这样导入数据行数不确认有时几十行,是否可以多选后导入到表单内数据表里,是否有相关代码例子 可以脚本赋值,参考:https://www.o2oa.net/cms/videoproblem/231.html 论坛管理员 发表于 2023-2-13 09:27
可以脚本赋值,参考:https://www.o2oa.net/cms/videoproblem/231.html
视频看懂了 但是视频还是单选指定输入框赋值 如何 视图多选 后将选择的多行数据赋值到表格内或数据表格内或多行表格内 就是把多选的数据分行 赋值到表单 如果要赋值到数据表格里,需要在数据表格外增加一个按钮多选,然后通过var line = this.form.get("dt1").addLine(data);的方式去添加多行数据
论坛管理员 发表于 2023-2-14 16:58
如果要赋值到数据表格里,需要在数据表格外增加一个按钮多选,然后通过var line = this.form.get("dt1").ad ...
应用里有相关例子吗?? 论坛管理员 发表于 2023-2-14 16:58
如果要赋值到数据表格里,需要在数据表格外增加一个按钮多选,然后通过var line = this.form.get("dt1").ad ...
this.form.get('view').getData() 这句代码获取到的data形式是什么样的,data里是个对象?数组还是其它的什么形式,在哪里可以查到?烦请回复,不胜感激 论坛管理员 发表于 2023-2-14 16:58
如果要赋值到数据表格里,需要在数据表格外增加一个按钮多选,然后通过var line = this.form.get("dt1").ad ...
你好我通视图查到要导入的数据后选择要的数据,再次点击查询可以在数据表格添加行但是没有数据到数据表格,只是在数据表格添加了行而已 请大神给看看是否可以给个例子谢谢var view = this.form.get("view");
var filterList = [];
if(this.form.get("lb").getData()){
filterList.push({
"logic": "and",
"path": "lb",
"comparison": "like",
"value": this.form.get("lb").getData(),
"formatType": "textValue",
"type": "restrict",
"title": "",
"code": {"code":"return \""+this.form.get("lb").getData()+"\";","html":"return \""+this.form.get("lb").getData()+"\";"},
"otherValue": ""
});
}
if(this.form.get("kssj").getData()){
filterList.push({
"logic": "and",
"path": "gjsj",
"comparison": "greaterThan",
"value": this.form.get("kssj").getData(),
"formatType": "textValue",
"type": "restrict",
"title": "",
"code": {"code":"return \""+this.form.get("kssj").getData()+"\";","html":"return \""+this.form.get("kssj").getData()+"\";"},
"otherValue": ""
});
}
if(this.form.get("jssj").getData()){
filterList.push({
"logic": "and",
"path": "gjsj",
"comparison": "lessThan",
"value": this.form.get("jssj").getData(),
"formatType": "textValue",
"type": "restrict",
"title": "",
"code": {"code":"return \""+this.form.get("jssj").getData()+"\";","html":"return \""+this.form.get("jssj").getData()+"\";"},
"otherValue": ""
});
}
if(this.form.get("ssbm").getData().length>0){
filterList.push({
"logic": "and",
"path": "ssbm",
"comparison": "like",
"value": this.form.get("ssbm").getData()[0].distinguishedName,
"formatType": "textValue",
"type": "restrict",
"title": "",
"code": {"code":"return \""+this.form.get("ssbm").getData()[0].distinguishedName+"\";","html":"return \""+this.form.get("ssbm").getData()[0].distinguishedName+"\";"},
"otherValue": ""
});
}
view.json.loadView = "yes";
view.json.filterList = filterList;
debugger;
var data_list = view.getData()
for(i = 0; i < data_list.length; i++){
this.form.get("dt").addLine(data_list)
this.form.get('dtbh').setData(data_list)
}
this.form.get('dt').reload();
this.form.get("view").reload();
var line = this.form.get("bh").addLine("bh")
没有样例哦,实际的样例提供这个是收费的技术支持服务呢。管理员这边只能给您解答平台的使用方面问题,给您提供思路:)
您的需求“只是在数据表格添加了行而已”不就是要给数据表格添加行吗,通过addLine就可以,addLine您可以看一下api,datatable的用法里有这个方法的使用样例说明
页:
[1]