如果一個字段包含多個項目的數組,則需要指定x個單位的計數。如何在ng-grid字段顯示名稱中執行此操作?在角度ng-grid中如何指定子數組的計數
的Json實施例: $ scope.data = [{ID:{1,3}, 納米:John Doe的} , {ID:{2,4,5}, 納米:Jane Doe的}]
當前結果:
Id Name
-------------- -------------------------------
1,3 John Doe
2,4,5 Jane Doe
期望的結果:
Id Name
-------------- -------------------------------
2 Ids John Doe
3 Ids Jane Doe
當前角代碼:
$scope.gridOptions = {
data: 'data',
selectedItems: $scope.mySelections,
columnDefs: [
{field: 'id', displayName: 'Id', width: '***'},
{field: 'nm', displayName: 'Name', width: '****'}],
multiSelect: false
};
是真的ID的對象還是一個數組:id:[1,3]? – michael