0
我有一些具有挑战性的要求,并寻找解决方案来动态呈现它。我会请专家来帮助我解决以下问题。通过JSON数据呈现动态表格
我需要呈现的数据按照上面的格式,如果需要JSON数据看起来以下的模板和更新
[ { Region: 'India' State: 'MH' Month: 'jan-16' visits: 10230157 }, { Region: 'India' State: 'DL' Month: 'jan-16' visits: 20023423 }, { Region: 'India' State: 'TL' Month: 'jan-16' visits: 38023804 }, { Region: 'India' State: 'RJ' Month: 'jan-16' visits: 65102322 }, { Region: 'India' State: 'KN' Month: 'jan-16' visits: 80234109 } ]
用作按照您的解决方案。
<div class="tablecontainer" ng-if="groups.length > 0" ng-repeat="cat in groups">
<div class="row rowspace">
<div>{{cat.group.name}}</div>
<div ng-if="cat.group.columns.length>0" ng-repeat="column in cat.group.columns">
<div>{{column.name}}</div>
</div>
</div>
<div class="row">
<table class="table table-striped table-bordered">
<tr>
<th ng-repeat="column in cat.cols">{{column}}</th>
</tr>
<tr ng-repeat="row in cat.rows">
<td ng-repeat="column in cat.cols">{{row[column]}}</td>
</tr>
</table>
</div>
</div>
这将是非常有益的,并感谢您的帮助。
谢谢
谢谢Faly。赞赏你的时间和努力。我需要动态呈现列,并且还需要显示一个问题(由于内部数组排序)。我会处理我自己的这些事情。再次感谢您的帮助。 –