【发布时间】:2014-03-31 19:48:22
【问题描述】:
我想在编辑后刷新 ng-grid 的数据或向数据库添加新数据。我尝试了本页 https://github.com/angular-ui/ng-grid/issues/39 中提出的解决方案。控制台上没有显示任何错误,表明存在问题。但是,当它触发该功能时,我得到的只是来自 ng-grid 的空白数据,并且不再显示所有以前的数据。我错过了什么?需要你的帮助。提前致谢。
这里是函数
self.fetchDataCenter = function() { 设置超时(函数(){ $http({ url:'api/centers', 类型:'GET'}) .成功(功能(dCenter){ $scope.centers = dCenter; if (!$scope.$$phase) { $scope.$apply(); } }); }, 3000); }; $scope.mySelectionsCenters = []; $scope.gridCenters = { 数据:'中心', filterOptions: $scope.filterOptionsCenters, selectedItems:$scope.mySelectionsCenters, afterSelectionChange:函数(){ $scope.itemsCC = $scope.mySelectionsCenters; }, 多选:假, columnDefs: [{field:'cost_center', displayName:'Cost Center'}] };【问题讨论】: