I need that in the cell of one of the columns (by condition if IsEnum = true) be select dropdown.
I do this:
$scope.gridOptions.data.forEach(function (dataItem) { var columnDef = {}; columnDef.cellTemplate = '<div ng-if="row.entity.IsEnum" style="padding: 2px 5px;text-align:center;"><select style="width:100%;height:28px;border-radius:3px;" ng-model="selectedEnumItem" ng-options="item.Name for item in dicEnumItems"></select></div>'; columnDef.field = 'Value'; columnDef.displayName = 'Значение'; ... if(dataItem.IsEnum){ referenceService.getDicEnum($scope.userId, dataItem.TypeName).then(function (dicEnums) { $scope.dicEnumItems = dicEnums.data; }); } $scope.gridOptions.columnDefs.push(columnDef); } As a result, an array is written to dicEnumItems. But for some reason, the dropdown is empty.
Plunker Link: https://plnkr.co/edit/EDE7UBb07upwIQFzj5WG?p=preview
in $parent.dicEnumItemsBut nowhere to check :-) - GrundygetDicEnumis asynchronous, and at the time of addingcolumnDef$scope.dicEnumItemsstill empty? But then it is not clear how to solve this problem. - endovitskiiy