I have a problem to populate dropdowns as cell template in ui-grid table. Can anyone help me please?
var cellSelectTemplate = '<select ng-change="change(status, row.entity)" ng-model="status" ><option ng-repeat="stat in dataStatuses" value="{{stat.id}}">{{stat.status}}</option></select>';
$scope.gridOptions1.columnDefs = [
{field: 'status', displayName: 'Status', width: '100', enableColumnMenu: false, cellTemplate: cellSelectTemplate},
];
$scope.loadData = function(){
$.GET(....).success(function(data){
$scope.gridOptions1.data = data["table"];
$scope.dataStatuses = data["statuses"];
});
}
Data are loaded after I will click the load button and call ng-click="loadData". All data were loaded to the table. If I debug $scope.dataStatuses variable, all data for statuses were loaded, but dropdown is still empty.
I used version with ng-options="stat.id as stat.status from stat in dataStatuses" as well, but without any effect.
Data are in folloving json format:
data[statuses]:[
{id:1;status:first},
{id:2;status:second},
...
]
data[table]:[
{id:1;status:1;........},
{id:2;status:1;........},
...
]