我有一个方案将单个网格视图拆分为多个网格视图,
示例:在数组中,我有10个数据,每个数据的值为[10],我必须使用角度js放置新的ui-grid。
客户1有10个唯一记录reg1,reg2,reg2数据,为此我必须在网格视图中显示
标签视图:
REG101 Customer 1
网格视图:
----------------------------------------------
Item1| shop| details |avaialbilty |Workshop
----------------------------------------------
标签视图:
REG102 Customer 2
网格视图:
----------------------------------------------
Item2| shop| details |avaialbilty |Workshop
----------------------------------------------
标签视图:
REG103 Customer 3
网格视图:
----------------------------------------------
Item3| shop| details |avaialbilty |Workshop
----------------------------------------------
答案 0 :(得分:0)
使用ng-repeat我们可以轻松实现这一目标。我已经做了一个示例代码来演示它
var app=angular.module('myapp',["ngGrid"]);
app.controller('mycontroller',function($scope){
$scope.Datas=[
{"data":[{"color":"red"
},{"color":"green"
},{"color":"amber"
}]},
{"data":[{"color":"blue"
},{"color":"violet"
},{"color":"pink"
}]},
{"data":[{"color":"steelblue"
},{"color":"yellow"
},{"color":"white"
}]}
];
$scope.gridOptions = [{data:'Datas[0].data'},{data:'Datas[1].data'},{data:'Datas[2].data'}];
});

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.min.js"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.min.js"></script>
<div ng-app='myapp'>
<div ng-controller='mycontroller'>
<!-- <div ng-repeat="item in Datas" facdata="item"></div> -->
<div ng-repeat="item in gridOptions" class="gridStyle" ng-grid="item"></div>
</div>
</div>
&#13;