2

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

4

1 回答 1

0

它与这条线有关。我不知道它做了什么,所以我不能对这个问题做进一步评论。没有它,这些功能就可以正常工作。您确定setDataToJsonFromExcel控制器中存在功能吗?

希望这可以帮助。

this.fixedDialog.attachBeforeClose(this.setDataToJsonFromExcel, this);
于 2018-09-12T17:37:55.323 回答