2013-10-17 88 views
0

我想在我的存儲加載後獲取響應標題。以這種方式加載我的商店Sencha Touch獲取響應標題

var storectn = Ext.getStore('Contactsstore'); 
storectn.loadPage(1,{ 
        callback: function (records, operation, success, response) { 
         if (success==1) { 
          // Ext.Msg.alert('success'); 
          // console.log('response contact api',response); 
          //var responseheader = response.getResponseHeader('Content-Type'); 
          //console.log('response header',responseheader); 
         } else { 

          var responsestatus = operation.error['status']; 
          Ext.Viewport.setMasked(false); 


         } 
        } 
       }); 

但是我沒有得到響應後加載我的商店,響應變量是printa未定義在我的控制檯。

我想這一個

var Location = response.getResponseHeader(); 

,但沒有得到響應,請幫我解決這個問題,謝謝

回答

0

我設法解決這個問題,如下面的方式

var storectn = Ext.getStore('Contactsstore'); 
storectn.loadPage(1,{ 
        callback: function (records, operation, success) { 
         if (success==1) { 
          console.log(operation.getResponse()) 
          console.log(operation.getResponse().getResponseHeader('content-type')) // here i will get the response header 
         } else { 

          var responsestatus = operation.error['status']; 
          Ext.Viewport.setMasked(false); 


         } 
        } 
       }); 

謝謝..