我有一个ExtJS grid.Panel,我必须在Ext.view.View中呈现一定数量的信息。有问题的数据打包为包含在行的JSON对象中的JSON对象,类似于:
{
data: [
{
firstName: "Bob",
lastName: "Bobkins",
age: 37,
steps: [
{
stepNumber: 1,
stepName: "Step 1",
status: "Complete"
},
{
stepNumber: 2,
stepName: "Step 2",
status: "Complete"
},
{
stepNumber: 3,
stepName: "Step 3",
status: "Incomplete"
},
{
stepNumber: 4,
stepName: "Step 4",
status: "Incomplete"
},
{
stepNumber: 5,
stepName: "Step 5",
status: "Incomplete"
}
]
},
{
firstName: "Jane",
lastName: "Jankins",
age: 26,
steps: [
{
stepNumber: 1,
stepName: "Step 1",
status: "Complete"
},
{
stepNumber: 2,
stepName: "Step 2",
status: "Complete"
},
{
stepNumber: 3,
stepName: "Step 3",
status: "Complete"
},
{
stepNumber: 4,
stepName: "Step 4",
status: "Complete"
},
{
stepNumber: 5,
stepName: "Step 5",
status: "Incomplete"
}
]
}
]
}
我的网格打算按照顶级项目为firstName,lastName和age组件呈现单独的列,并在视图组件的视图中呈现每个步骤。
我可以将浏览器控制台日志中的步骤信息看作对象;我可以将对象中的信息渲染到网格中呈现的Ext.view.View吗?如果是这样,怎么样?
答案 0 :(得分:0)
您可以使用steps对象中的字段将Ext.view.View绑定到商店,然后使用以下代码加载商店数据:
var steps = selectedData.steps[0];
myStore.loadData(steps);
上面的代码是用于加载所选人员的数组位置0中的步骤的示例。