你好,我的 JSON 是:(格式化以便更好地阅读)
{"status":{"status":0,"msg":"Ok","protocolversion":"extjs.json"},
"list":[{"getLogfiles":[
{"key":"0","value":"...lugin\/monitor\/files\/x_worker_error.log"},
{"key":"1","value":"...les\/x-worker01-progress.log.1331769600"},
{"key":"2","value":"...\/application\/x\/plugin\/monitor\/files\/Test.log"},
{"key":"3","value":"...ind\/plugin\/monitor\/files\/logfile_for_navi_test.log"},
{"key":"4","value":"...lugin\/monitor\/files\/logfilefilter_worker_error.log"}]
}]
}
此 json 数据已成功加载,我可以在 console.log() 上打印它,但它没有加载到我的商店:
...
Ext.define( 'Xxx.plugins.monitor.store.GridLogfiles', {
extend : 'Ext.data.Store',
mixins: [
'Deft.mixin.Injectable'
],
model: 'Xxx.plugins.monitor.model.GridLogfiles',
proxy : {
type : 'ajax',
url : 'xxx',
extraParams: {
user : 'test',
pass : 'test',
vers : 'extjs.json',
module : 'monitor',
func : 'getLogfiles'
},
reader : {
type: 'json',
root: 'list[0].getLogfiles',
// root: 'list',
successProperty:false
}
}
, autoLoad: true
} );
...
我都试过root: 'list'
了root: 'list[0].getLogfiles
在console.log()
数据下找到rawData (obj) -> list (array) -> 0 -> getLogfiles (array) -> 0, 1, 2 -> key, value
怎么了?谢谢!