我想遍历JSON对象的内部列表并在HTML上显示

时间:2013-08-27 20:05:54

标签: html json spring

目前,我只能显示外部列表数据而不显示keyStats。 我想要的是每当currentNumberOfEntries大于0时,我想直接从相应列标题下的下一行显示keyStats数据。否则继续下一个数据。

[{
  "cacheName" : "PIPELINE",
  "urlName" : null,
  "keyName" : null,
  "hits" : 0,
  "misses" : 0,
  "currentNumberOfEntries" : 0,
  "keyStats" : [ ]
}, {
  "cacheName" : "REQUEST",
  "urlName" : null,
  "keyName" : "key"
  "hits" : 2,
  "misses" : 4,
  "currentNumberOfEntries" : 3,
  "keyStats" : [ {
  "cacheName" : "REQUEST",
  "keyName" : "1722957",
  "hits" : 0,
  "misses" : 0
}, {
  "cacheName" : "REQUEST",
  "keyName" : "SummaryRequest",
  "hits" : 0,
  "misses" : 0
}, {
  "cacheName" : "REQUEST",
  "keyName" : "LOAD_SUMMARY",
  "hits" : 0,
  "misses" : 0
 } ]
}, {
  "cacheName" : "Filter",
  "urlName" : null,
  "keyName" : null,
  "hits" : 0,
  "misses" : 0,
  "currentNumberOfEntries" : 0,
  "keyStats" : [ ]
} ]

这是我的专栏定义:

 columnDefs : [
{
field:'cacheName',
displayName:'   Cache Name          '
},{
field : 'currentNumberOfEntries',
displayName:'   Number of entries           '
},{
field : 'keyName',
displayName:'   Cache Key           ',
cellTemplate : '<a href>{{row.keyName}}</a>'
 },{
field : 'hits',
displayName:'   Number of Hits      '
 },{
field : 'misses',
displayName:'   Number of Misses    '
 } ]

感谢任何帮助

0 个答案:

没有答案