ui-grid
我需要在一行中显示数组中的每个数据。请帮助我,它是否正确?所以data[0]
应该显示在一个中ui-grid
,data[1]
应该显示在另一个中ui-grid
,所以它ui-grid
在一个页面中看起来是多个。但是请针对每种情况帮助我解决这种情况,因为我不知道有多少数据。
控制器.js:
$rootScope.viewFollowup; // In this am having 'n' of datas only
$scope.gridView={};
$scope.data1= $.makeArray($rootScope.viewFollowup[0]);
$scope.data2= $.makeArray($rootScope.viewFollowup[1]);
$scope.data3= $.makeArray($rootScope.viewFollowup[2]);
//$scope.gridOptions -- in this grid options am having all the columndefs details
$scope.aa=$scope.gridOptions;
$scope.aa.data= $scope.data1;
$scope.ab= $scope.gridOptions;
$scope.ab.data= $scope.data2;
$scope.ac=$scope.gridOptions;
$scope.ac.data=$scope.data3;
$scope.gridView=[$scope.aa,$scope.ab,$scope.ac];
$rootScope.tabledata=$scope.gridView;
HTML:
<div class="row" ng-repeat="group in tabledata track by $index">
<div ui-grid="group" page-equalheight ui-grid-resize-columns ui-grid-selection ui-grid-auto-resize class="grid" style=style="height:250px"></div>
</div>
输出:
Grid View 1
-------------------------------------------
a| b| c|d|
-------------------------------------------
Grid View 2
-------------------------------------------
c| d| e|f|
-------------------------------------------
but what am getting is:
Grid View 1
-------------------------------------------
c| d| e|f|
-------------------------------------------
Grid View 2
-------------------------------------------
c| d| e|f|
-------------------------------------------