2016-08-12 68 views
0

我們開發c#.NET應用程序,javascript和使用EXTJS(6.0.2)。 適用於所有瀏覽器的個人電腦平臺 ,但對於iPad Chrome我們在提交表單時出現問題/選項卡 新窗口/選項卡無法打開。iPad Chrome - 提交表單在新窗口/標籤不工作

這裏是代碼...

test.init = function (config) { 

    var submitButtonHandler = function (scope, eArgs) { 
     var params = { 
      q: 'test', 
     }; 

     submitForm.submit({ 
      params: params 
     }); 

    } 


    var action = 'https://www.google.com/'; 
    var hiddenFormValues = Ext.create('Ext.Component', {}); 
    var submitForm = Ext.create('Ext.form.Panel', { 
     autoEl: { 
      tag: 'form', 
      method: 'post', 
      target: '_blank', 
      action: action 
     }, 
     buttons: [{ 
      text: 'Click to test', 
      handler: submitButtonHandler, 
      exportMethod: 'openhtml', 
      xtype: 'TestButton' 
     }], 

     submit: function (config) { 
      config.params = config.params || {}; 
      var keys = Object.keys(config.params); 
      var html = ''; 
      for (var i = 0; i < keys.length; i++) { 
       var key = keys[i]; 
       var value = config.params[key]; 
       if (typeof (value) === "string") value = value.replace(/'/g, "&#39;"); 
       html += '<input type="hidden" name="' + key + '" value=\'' + value + '\'/>'; 
      } 
      alert(html); 
      hiddenFormValues.update(html); 
      alert(this.id); 
      document.getElementById(this.id).submit(); 
     } 

    }) 

    return submitForm; 
} 

對於PC Chrome中打開新標籤窗口就好了

但對於iPad的Chrome瀏覽器不會再開新/標籤窗口,不能正常工作。

任何建議表示讚賞, 謝謝

回答

0
if (form.isValid()) { 
    form.submit({ 
    url: 'http://localhost:8080/WAR_project/rest/service/ticket/uploadfile', 
    waitMsg: 'Uploading Please Wait...', 
    method: 'POST',      
    success: function (r, a) { 
     console.log('success message here') 
    }, 
    failure: function (r, a) {      
     console.log('failure message here') 
    } 
    }); 
}