我正在实现一个 FileUploader,显示在一个对话框中。相关代码:
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 函数之前定义一个新变量。但即使我添加了该变量,我仍然得到错误。有没有人有进一步的想法?