开发者

Extjs file upload request stays on waitMsg

开发者 https://www.devze.com 2023-03-20 12:07 出处:网络
Through an ExtJs form I am uploading a file for processing in php (csv file in this matter). The processing all works fine without errors or anything. And as far as I know, all of the other requireme

Through an ExtJs form I am uploading a file for processing in php (csv file in this matter).

The processing all works fine without errors or anything. And as far as I know, all of the other requirement for a proper response are met.

  1. Return message = {success: true}
  2. Response header Content/Type = text/html
  3. Status = 200 OK

However ExtJs keeps showing my WaitMsg instead of going to my success of failure functions

Here is my form:

var form = new Ext.FormPanel({
            id :         'mailinglist_form_import',
            labelWidth : 210,
            fileUpload : true,
            border :     false,
            url :        '/plugin/NewsletterManagement/mailinglist/import',
            items :      [{
                xtype :       'fieldset',
                width :       560,
                border :      false,
                autoHeight :  true,
                labelWidth :  215,
                defaultType : 'textfield',
                defaults :    {
                    width :      307,
                    labelStyle : 'font-weight: bold;'
                },
                items :       [{
                    fieldLabel : t('Name') + ' *',
                    name :       'mli_name',
                    allowBlank : false
                },{
                    xtype :      'textfield',
                    fieldLabel : t('File') + ' *',
                    name :       'file', 
                    inputType :  'file'
                }]
            }]
    });

The button:

var saveBtn = new Ext.Button({
            text: t("Save"),
            iconCls: 'pimcore_icon_save',

            handler: function() {
                form.getForm().submit({
                    waitMsg: t('Saving...'),
                    success: function () {
                        var tabpanel  = Ext.getCmp("pimcore_panel_tabs");
                        Ext.MessageBox.alert (t('开发者_高级运维Message'),t('Data has been saved'));
                        form.getForm().reset();
                        grid.getStore().reload();
                        tabpanel.activate(gridTabId);
                        tabpanel.remove(tabId);
                    },
                    failure: function () {
                        Ext.MessageBox.alert (t('Message'),t('Saving data failed'));
                    }
                });
            }
        });

The PHP file contains an echo:

echo "{'success': true}";

Any help is greatly appriciated.

Greetz, XpertEase


Open console and see the error. If you dont's see both of your alerts -- then it's some error in code, in extjs side. Understand it, fix and then report back.

0

精彩评论

暂无评论...
验证码 换一张
取 消