ストアをロードしようとするたびに、内部サーバー500エラーが発生します。私は現在、必要なデータを含むAPIエンドポイントに接続しようとしています。これは、(空だと思われる、「受け入れる]ヘッダーをチェックし、FYI私は私が正しくそれに接続するためにそこにapplication/json
を持つことができるかわからない。)私はすべての時間を取得していますエラーです:ExtJS 4.2 - ストアをロードするときに内部サーバーエラー500
私の店は、このような設定である:
Ext.define('EcommBackoffice.store.TierCapacity', {
extend: 'Ext.data.Store',
model: 'EcommBackoffice.model.TierCapacityModel',
storeId: 'tier-capacity-id',
autoLoad: true,
sorters: [{
property: 'name',
direction: 'ASC'
}],
proxy: {
type: 'rest',
url: EcommBackoffice.Global.getAPIEndPoints().tier_capacity + '?siteCode=bgp88',
reader: {
type: 'json',
root: ''
},
listeners: {
exception: function(proxy, response, op) {
if (response.status === 403 || response.status === 401) return; /*skip this exception handler and check App exception handler*/
Ext.Msg.alert('ERROR', response.responseText + ' ' + response.statusText);
}
}
}
});
そして、このように私のモデル:
Ext.define('EcommBackoffice.model.TierCapacityModel', {
extend: 'Ext.data.Model',
fields: [{
name: 'id'
}, {
name: 'paymentOption',
type: Ext.data.SortTypes.asUCString
}, {
name: 'tier',
type: Ext.data.SortTypes.asUCString
}, {
name: 'media',
type: Ext.data.SortTypes.asUCString
}, {
name: 'channels',
type: Ext.data.SortTypes.asUCString
}]
});
APIはこのようなものが含まれています:
[{
"name": "DEBIT",
"tiers": [{
"name": "Default",
"media": [{
"name": "OFFICE",
"channels": [{
"name": "CHANNEL-001",
"currentVolume": 0,
"maxVolume": 0,
"yesterdayVolume": 0
}]
}]
}]
}]
また、私はモデルとストアの設定にはあまり慣れていません。私はそれが私が何かを逃していると仮定しています。 APIレスポンスに基づいてモデルを正しく構造化していますか?私はドキュメントを読むことを試みたが、私はまだそれの周りに私の頭を包むことはできません。