这个主题已在网上多次讨论,但所有主题都没有帮助我解决我的问题.我的javascript代码接收JSON嵌套数据.所有JSON数据1级数据都在网格面板中转录,但所有子数据都没有.我尝试了很多方法,但不可能.这就是我要求你帮助我的原因.
我的JSON:
{
"success":true,
"error":false,
"redirectUrl":null,
"fund":[{
"cat_id":1,
"catname":"Europe OE Japan Large-Cap Equity",
"region":{
"region_id":2,
"region_name":"JAPAN"
}
},{
"cat_id":2,
"catname":"Europe OE Europe Large-Cap Growth Equity",
"region":{
"region_id":1,
"region_name":"EUROPE"
}
}]
}
Run Code Online (Sandbox Code Playgroud)
我的型号:
var Recommended = new function() {
this.DataModel = function() {
Ext.define('Fund', {
extend: 'Ext.data.Model',
fields: [{
name: 'catname',
type: 'string'
},{
name: 'cat_id',
type: 'int'
}],
proxy :{
type: 'rest',
url: application +'directory/function',
reader: {
type: 'json',
root: 'fund'
}
},
associations: [{
type: 'hasOne',
model: 'Region',
primaryKey: …
Run Code Online (Sandbox Code Playgroud)