[
{
"@aircraftId": "8a8aa3943e3ee05c013e3f59930d06df",
"tailNumber": "QA14",
"stockNumberCode": "ST-AC-B5S"
},
{
"@aircraftId": "8a8aa3943e62f9de013e63433f790034",
"tailNumber": "QACU2",
"stockNumberCode": "QA-ST-CU2"
},
{
"@aircraftId": "8a8aa3943e62f9de013e63455362004b",
"tailNumber": "453201",
"stockNumberCode": "SN453201"
},
{
"@aircraftId": "8a8aa3943e3ee05c013e3eea2db3000d",
"tailNumber": "HR455",
"stockNumberCode": "HR ST THUR"
},
{
"@aircraftId": "8a8aa3943e62f9de013e6356190601a2",
"tailNumber": "N171",
"stockNumberCode": "E171"
},
{
"@aircraftId": "8a8a95ca38104bbb01381fcaf8e43831",
"tailNumber": "N760CP",
"stockNumberCode": "E170"
},
{
"@aircraftId": "8a8aa3943e3ee05c013e3f1896bb065e",
"tailNumber": "123",
"stockNumberCode": "ST-12345"
},
{
"@aircraftId": "8a8aa3943e3ee05c013e405d25f70846",
"tailNumber": "143",
"stockNumberCode": "MPR"
},
{
"@aircraftId": "8a9e82af3eef9d3a013ef0805ca30022",
"tailNumber": "ARN 0529",
"stockNumberCode": "ACS 0529"
},
{
"@aircraftId": "8a9e82af3ef3d12a013ef41de5590067",
"tailNumber": "ARN 0530",
"stockNumberCode": "ACS 0530"
},
{
"@aircraftId": "8a9e82af3ef3d12a013ef41c976e0058",
"tailNumber": "ARN 30",
"stockNumberCode": "ACS 30"
}
]
これは、残りのサービスからの私の json 応答です。これが私のモデルとストアです。
Ext.define('FCELB.store.AircraftStore', {
extend: 'Ext.data.Store',
config: {
model: 'FCELB.model.AircraftModel',
storeId: 'aircraftstore',
autoLoad:false,
proxy: {
type: 'jsonp',
method:'Get',
url: 'http://10.30.2.139:8080/xl/api/1/aircrafts/json',
reader: {
type: 'json'
},
headers: {
'Accept':'application/json'
} ,
listeners: {
load : function(store, records, successful, operation, eOpts) {
console.log('Aircrafts load..');
}
}
}
}
});
確認してください、私のストア クラスに欠けているものがあります。正常に解析できるようです。json の読み取りで問題が発生していないようですが、コールバックで結果オブジェクトの長さがゼロになっています。
これがjsonのストアコールです
var store = Ext.create('FCELB.store.AircraftStore');
//store.load();
store.load({
callback: function (records, operation, success) {
console.log('rest service called' + records);
},
failure: function (record, operation) {
console.log('invode failed returend records' + record);
},
success: function (record, operation) {
console.log('in success function' + record);
}
});
上記のjson形式のモーダル定義は次のとおりです
Ext.define('FCELB.model.AircraftModel', {
extend: 'Ext.data.Model',
config: {
fields: [
{name: 'tailNumber', mapping:'tailNumber' }
]
//hasMany:'aircraft'
}
});