2016-11-24 3 views
1

私は自分のストア上でロードリスナーを使用しています。ストア内のロードリスナー

listeners: { 
    load: function (store, records, success, opts) { 

    } 
} 

成功= falseをが、私はそれが失敗した理由をHTTPレスポンスからのエラーメッセージ、または何かを取得したい場合は

https://docs.sencha.com/extjs/4.1.0/source/AbstractStore.html#Ext-data-AbstractStore-event-load

この情報はどこで入手できますか?

答えて

1

ストアプロキシでexceptionイベントを探しています。

このフィドルをチェックhttps://fiddle.sencha.com/#view/editor&fiddle/1l5m

Ext.define('MyApp.store.MyJsonStore', { 
    extend: 'Ext.data.Store', 

    requires: [ 
     'Ext.data.proxy.Ajax', 
     'Ext.data.reader.Json' 
    ], 

    autoLoad: true, 
    storeId: 'MyJsonStore', 
    proxy: { 
     type: 'ajax', 
     url: 'non-existing-data.json', 
     reader: { 
      type: 'json' 
     }, 
     listeners: { 
      exception: function (proxy, response, operation, eOpts) { 
       // debugger; 
      } 
     } 
    } 
}); 
関連する問題