html - AngularJS - ng-repeat inside of ng-grids cellTemplate -
given following data set:
{ "url": "www", "words": [ { "name": "fish", "count": 1 }, { "name": "pig", "count": 60 } ] }, { "url": "www", "words": [ { "name": "zebra", "count": 0 }, { "name": "cat", "count": 12 } ] }, { "url": "www", "words": [ { "name": "dog", "count": 0 }, { "name": "antilope", "count": 2 } ] }
i'd create grid like:
url words:count --------|-------------- | | fish:1 | | www | pig:60 |
etc...
in controller, i've tried follwing configuration:
$scope.gridoptions = { data: 'data', columndefs: [ {field:'url', displayname:'url'}, {displayname:'words:count', celltemplate: '<div class="ngcelltext"><div ng-repeat="word in row.entity.words">{{word.name + ":" + word.count}}</div>'} ] }
but first word:count, , not entire set.
i've tried looking through docs, couldn't find anything,
what missing?
did check height of grid? here's plnkr code , working.
style.css
.gridstyle { border: 1px solid rgb(212,212,212); width: 400px; height: 300px; }
javascript:
... $scope.gridoptions = { ... rowheight: 80 // height of each row ... }; ...
index.html
<div class="gridstyle" ng-grid="gridoptions"></div>
Comments
Post a Comment