UI5中的表绑定

2020-09-17 05:10发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)你好专家 我正在尝试开发一...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


你好专家

我正在尝试开发一个应用程序,其中上传了csv,然后将其显示在表格中以供审核。 我可以使用csv上传文件,并且相信我已经正确创建了json,但是无论如何尝试,我都无法使数据显示在表格中。

这是我的控制者:

uploadCSVFile:function(oEvent){var that = this; var file = oEvent.getParameter(" files")[0]; if(file && window.FileReader){var reader = new FileReader(); reader.onload = function(evn){var strCSV = evn.target.result; //CSV中的字符串var jsonCSV = that.csvJSON(strCSV); console.log(jsonCSV); var oModel = new sap.ui.model.json.JSONModel(); //将JSON载入模型oModel.loadData(jsonCSV); sap.ui.getCore()。setModel(oModel); }; reader.readAsText(file); }},

这是我的观点:

<表id =" pirTable"项目=" {uploadData>/}"> <列> <列> <文本text ="材料"> <列> <文本text =" Plant"> <文本text =" {uploadData> mrparea}"> <文本text =" {uploadData> rtype}"> <文本text =" { uploadData> version}"> <文本text =" {uploadData> quantity}"> <文本text =" {uploadData> mrpcont 滚子}">

这是语句的控制台日志输出:

{"材料":" YPIR001","植物":" 1710"," mrparea":" 1710"," rtype":" VSF","版本":" 0","句号":" 612018 ","句点类型":" M"," baseuom":" PC","数量":" 100"," mrpcontroller \ r":" 1 \ r"},{" material":" YPIR001","工厂 ":" 1710"," mrparea":" 1710"," rtype":" VSF"," version":" 0"," period":" 712018"," periodtype":" M"," baseuom": " PC","数量":" 100"," mrpcontroller \ r":" 1"}]

谢谢!