我正在实现一个文件上传程序,显示在一个对话框中。相关代码:
function onAddExcelData() {
var that = this;
if(this.fixedDialog === undefined) {
this.fixedDialog = new sap.m.Dialog({
title: "Choose CSV File for Upload",
beginButton: new sap.m.Button({
text: "Upload",
press: function(oEvent) {
that.fixedDialog.close();
}
}),
content: [
new sap.ui.unified.FileUploader("excelUploader")
],
endButton: new sap.m.Button({
text: "Cancel",
press: function() {
that.fixedDialog.close();
}
})
})
this.getView().addDependent(this.fixedDialog);
this.fixedDialog.attachBeforeClose(this.setDataToJsonFromExcel, this);
}
this.fixedDialog.open();
}
每当我想单击beginButton或endButton时,控制台就会显示错误
Uncaught TypeError: I.fFunction.call is not a function
我读过关于这个问题的文章,建议的解决方案总是在调用press函数之前定义一个新变量。但是即使我添加了那个变量,我仍然得到了错误。有人有进一步的想法吗?