0

这个是有线的。

这从网格工具栏按钮单击触发:

// fires when the client hits the add attachment button.
onAddAttachmentClick: function () {
    var uploadAttachmentsWindow = new Nipendo.ProformaInvoice.Attachment.UploadWindow({
        invoice: this.invoice,
        maxFileSizeInMB: this.maxFileSizeInMB
    });

    uploadAttachmentsWindow.on('uploadcomplete', function (win, message) {
        if (message.msg !== 'success') {
            return;
        }

        win.close();
        var store = this.getStore();

        store.setBaseParam('useCache', false);
        store.load();

        this.fireEvent(
            'attachmentuploaded',
            this.invoice.ProformaInvoiceNumber,
            this.invoice.VendorSiteID,
            this.invoice.CustomerSiteID);

    }, this);

    uploadAttachmentsWindow.show();
} // eo onAddAttachmentClick

这是 uploadcomplete 事件发生的情况:

this.uploadBtn.on('click', function () {
    var form = this.uploadForm.getForm();

    if (!form.isValid()) {
        return;
    }

    form.submit({
        url: 'XXX.ashx',
        waitMsg: Nipendo.Localization.UploadingAttachment,
        scope: this,
        success: function (form, action) {
            this.fireEvent('uploadcomplete', this, {
                msg: 'success',
                response: action.response
            });
        },
        failure: function (form, action) {
            switch (action.failureType) {
                case Ext.form.Action.CLIENT_INVALID:
                    this.fireEvent('uploadcomplete', this, {
                        msg: 'Form fields may not be submitted with invalid values'
                    });
                    break;
                case Ext.form.Action.CONNECT_FAILURE:
                    this.fireEvent('uploadcomplete', this, {
                        msg: 'Ajax communication failed'
                    });
                    break;
                case Ext.form.Action.SERVER_INVALID:
                    Ext.Msg.alert(action.result.title, action.result.message);
                    this.fireEvent('uploadcomplete', this, {
                        msg: action.result.message
                    });
                    break;
            }
        }
    });

}, this);

在 IE 8 上,我在调试器中收到此错误:

在此处输入图像描述

我不知道缺少什么对象...根据我的检查,它们都已定义。

有人知道吗?

请注意,我有一个从侦听器触发的事件(我怀疑它是问题的根源)。

很难看到,但是在 fire 方法中的 ext-all.js 中出现了错误。

4

1 回答 1

1

我在以下网址找到了答案:https ://stackoverflow.com/a/3584887/395890

问题是我列出的事件是 2 个不同的窗口,这在 Ext 中是不可能的。

我为解决它所做的是从弹出窗口调用 opner 窗口以通知更改。

于 2012-09-05T14:07:08.587 回答