sapui5 csv到表动态

2020-08-23 11:35发布

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

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


亲爱的,我有以下有关该错误的查询:

onInit:function(){DATABINDING = false; this.router = sap.ui.core.UIComponent.getRouterFor(this); this.router.getRoute(" Form")。attachPatternMatched(this._onObjectMatched,this); this.reference_id = 0; //this.user = sap.ui.getCore()。getModel()。setProperty(" name"," {/myName}"); var oModel = new sap.ui.model.json.JSONModel(); this.getView()。setModel(oModel); sap.ui.getCore()。setModel(oModel); },onConfirmDialog:function(){var that = this; var dialog = new sap.m.Dialog({title:'Upload',type:'Message',icon:'sap-icon://download',content:[new sap.ui.unified.FileUploader({id: 'fileuploader',宽度:'100%',uploadUrl:'upload/',更改:function(oEvent){var file = oEvent.getParameter(" files")[0]; if(file && window.FileReader){var reader = new FileReader(); reader.onload = function(evn){var strCSV = evn.target.result;//CSV中的字符串that.csvJSON(strCSV);}; reader.readAsText(file);} dialog.close ();}})],endButton:new sap.m.Button({text:'cancel',按下:function(){dialog.close();}}),afterClose:function(){dialog.destroy( );}}); dialog.open(); },csvJSON:function(csv){var lines = csv.split(" \ n"); var result = []; var headers = lines [0] .split(","); for(var i = 1; i

-----------------------------------错误----------- -------------------------------------------------- ----

错误的TypeError:this.oTable.bindAggregation在FileReader.reader的builder.csvJSON(Form.controller.js?eval:114)的构造函数.generateTable(Form.controller.js?eval:134)处不是函数。 onload(Form.controller.js?eval:77)

有什么建议吗? 是要上传一个csv文件并生成一个表格,问候

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

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


亲爱的,我有以下有关该错误的查询:

onInit:function(){DATABINDING = false; this.router = sap.ui.core.UIComponent.getRouterFor(this); this.router.getRoute(" Form")。attachPatternMatched(this._onObjectMatched,this); this.reference_id = 0; //this.user = sap.ui.getCore()。getModel()。setProperty(" name"," {/myName}"); var oModel = new sap.ui.model.json.JSONModel(); this.getView()。setModel(oModel); sap.ui.getCore()。setModel(oModel); },onConfirmDialog:function(){var that = this; var dialog = new sap.m.Dialog({title:'Upload',type:'Message',icon:'sap-icon://download',content:[new sap.ui.unified.FileUploader({id: 'fileuploader',宽度:'100%',uploadUrl:'upload/',更改:function(oEvent){var file = oEvent.getParameter(" files")[0]; if(file && window.FileReader){var reader = new FileReader(); reader.onload = function(evn){var strCSV = evn.target.result;//CSV中的字符串that.csvJSON(strCSV);}; reader.readAsText(file);} dialog.close ();}})],endButton:new sap.m.Button({text:'cancel',按下:function(){dialog.close();}}),afterClose:function(){dialog.destroy( );}}); dialog.open(); },csvJSON:function(csv){var lines = csv.split(" \ n"); var result = []; var headers = lines [0] .split(","); for(var i = 1; i

-----------------------------------错误----------- -------------------------------------------------- ----

错误的TypeError:this.oTable.bindAggregation在FileReader.reader的builder.csvJSON(Form.controller.js?eval:114)的构造函数.generateTable(Form.controller.js?eval:134)处不是函数。 onload(Form.controller.js?eval:77)

有什么建议吗? 是要上传一个csv文件并生成一个表格,问候

付费偷看设置
发送
3条回答
shere_lin
1楼-- · 2020-08-23 11:39

非常感谢Antonio在这里重新插入代码的关注,该错误使我陷入bindAgreggation中-这不能将我识别为函数,它将对这个问题有任何参考吗?

Climb_Ma
2楼-- · 2020-08-23 11:48

可以使用注释工具栏中的"插入代码"按钮再次粘贴代码吗?

Violet凡
3楼-- · 2020-08-23 12:02
 sap.ui.define([
 " jquery.sap.global",
 " sap/ui/core/mvc/Controller",
 " sap/ui/model/json/JSONModel",
 " sap/m/Column",
 " sap/m/ColumnListItem",
 "汁液/米/标签",
 " sap/m/Text",
 " sap/m/MessageToast",
 " sap/m/TabContainerItem",
 " sap/m/MessageBox",
 " sap/ui/model/Filter",
 " sap/ui/unified/FileUploader",
 " sap/ui/core/mvc/Controller",
 " sap/ui/model/json/JSONModel",
 " sap/m/MessageToast",
 " sap/ui/model/base/ManagedObjectModel",
 " sap/m/TabContainerItem",
 " sap/m/MessageBox",

 ]),
    
 函数(jQuery,控制器,过滤器,JSONModel,列,ColumnListItem,标签,文本,MessageToast,MOM){
 "使用严格";


 var InputController = Controller.extend(" sap.ui.unified.cmpcclient1.Form.Controller",{
 }

 );

 var tableController = Controller.extend(" sap.ui.base.cmpcclient1.Form.Controller",{
 }

 );


 return tableController;
 },

 sap.ui.controller(" cmpcclient1.Form",{


/**
 *在实例化控制器并且已经创建其View控件(如果有)时调用。
 *可用于在视图显示之前对其进行修改,绑定事件处理程序以及进行其他一次性初始化。
 * @memberOf portalvendor.Input
 */

 onInit:function(){
 DATABINDING = false;
 this.router = sap.ui.core.UIComponent.getRouterFor(this);
 this.router.getRoute(" Form")。attachPatternMatched(this._onObjectMatched,this);
 this.reference_id = 0;
//this.user = sap.ui.getCore()。getModel()。setProperty(" name"," {/myName}");
 var oModel = new sap.ui.model.json.JSONModel();
 this.getView()。setModel(oModel);
 sap.ui.getCore()。setModel(oModel);

 },



         onSelectionChange:function(oEvent){
           var oSelectedItem = oEvent.getParameter(" listItem");
           var oModel = oSelectedItem.getBindingContext()。getObject();
           alert(JSON.stringify(oModel));
         },


         handleUpload:function(oEvent){
           var that = this;
           var oFile = oEvent.getParameter(" files")[0];
           如果(oFile && window.FileReader){
             var reader = new FileReader();
             reader.onload = function(evt){
               var strCSV = evt.target.result; //CSV字符串
               that.csvJSON(strCSV);
             };
             reader.readAsText(oFile);
           }
         },


         csvJSON:function(csv){
           var lines = csv.split(" \ n");
           var result = [];
           var headers = lines [0] .split(",");
           for(var i = 1; i                                                                     

一周热门 更多>