Make use of the celltemplate
for each cell and then reference the fields you want by using row.entity.<FIELD>
…here is an example:
var nameAgeCellTemplate = '<div class="ngCellText" ng-class="col.colIndex()">{{row.entity.name}} ({{row.entity.age}})</div>';
var friendsCellTemplate = '<div class="ngCellText" ng-class="col.colIndex()"><span ng-repeat="friend in row.entity.friends">{{friend.name}}{{$last ? '' : ', '}}</span></div>';
$scope.gridOptions = {
columnDefs: [
{
displayName: 'Name (age)',
cellTemplate: nameAgeCellTemplate
},
{
displayName: 'Friends',
cellTemplate: friendsCellTemplate
}
]
};
This would result in a table like this:
+----------------------+--------------------------------------------------+ | Name (age) | Friends | +----------------------+--------------------------------------------------+ | Rivers Navarro (36) | Frazier Jefferson, Polly Estes, Klein Cleveland | +----------------------+--------------------------------------------------+