2013-10-24 22 views
0

我成功上傳文件與extjs文件上傳面板。Extjs - 上傳文件,但屏幕卡住「灰色」

我的問題是,我上傳文件後,waitMsg消失,但沒有重新聚焦在我的應用程序,它卡在一個灰色屏幕中的screan。

Example

{ 
           xtype: 'button', 
           id: 'btnUploadExcelBidId', 
           icon: 'images/V16x16.png', 
           text: 'load', 
           listeners: { 
            click: { 
             fn: function(button, e, options) { 
              Ext.create('Ext.form.Panel', { 
               title: 'Upload Bid', 
               width: 400, 
               bodyPadding: 50, 
               margin: 300, 
               frame: true, 
               renderTo: Ext.getBody(), 
               items: [{ 
                xtype: 'filefield', 
                name: 'photo', 
                fieldLabel: 'Photo', 
                labelWidth: 50, 
                msgTarget: 'side', 
                allowBlank: false, 
                anchor: '100%', 
                buttonText: 'Select Excel...' 
               }], 

               buttons: [{ 
                text: 'Upload', 
                handler: function() { 
                 var form = this.up('form').getForm(); 
                 this.up('window').close(); 
                 if(form.isValid()){ 
                  alert('starting upload'); 
                  form.submit({ 
                   url: 'UploadExcel.jsp', 
                   waitMsg: 'Uploading Excel...', 
                   waitMsgTarget: true, 
                   success: function(fp, o) { 
                    alert('Your photo "' + o.result.file + '" has been uploaded.'); 
                   }, 
                   failure: function(fp, o) { 
                    alert('fail'); 
                   }   
                  }); 
                 } 
                } 
               }] 
              }); 
             } 
            } 
           } 
          } 
+0

你能發佈源代碼嗎? – shiva

+0

添加了源 – susparsy

回答

0

看在the doc about waitMsg的意見。似乎有一個4.1.2的錯誤,並且有一個烏托邦和LDSP發佈的解決方法:

success: function(form, action) { 
    Ext.Msg.alert('Success', action.result.msg); you can optionnaly hide it with .hide() 
}