我有一家网格商店,里面有类似的东西。
var gridStore = Ext.create('Ext.data.Store',{
proxy : {
type : 'ajax',
actionMethods : {
read : 'POST'
},
url : 'getECIAgentWrapperJobs.do',
reader : {
type : 'json',
rootProperty : 'rows',
totalProperty : 'results'
}
},
pageSize : 3,
autoLoad : {start: 0, limit: 3}
});
显然它向 url 发出了 AJAX 请求。
我收到的这家商店的 JSON 响应如下所示:
{
"results":2,
"rows":[
{
"pkTable1":1,
"name":"Rick",
"eciAgentJob":{
"pkTable2":11,
"name":"Play Local Ar",
},
}
],
"msg":null,
"success":true,
}
现在我的网格是这样的:
var mappedEciAgentJobsGrids = Ext.create('Ext.grid.Panel',{
store : gridStore,
columns : [
{
dataIndex : 'pkTable1',
header : 'Pk of table 1'
},
{
dataIndex : 'name',
header : 'Name'
},
{
dataIndex : 'eciAgentJob.pkTable2',
header : 'Pk of Table 2'
}
]
});
现在,在我的 UI 中,前 2 列(分别带有 dataIndex:pkTable2 和名称)加载良好。但对于第三个则不然。
我知道这是因为我使用了 dataIndex 作为“eciAgentJob.pkTable2”。但是,当我们像我得到的那样得到响应时,在列中加载数据的方法是什么(其中 eciAgentJob 是原始 JSON 中的对象)。
请帮忙。
编辑:由于其他一些用例原因,我不想使用渲染。