摘要:ng-grid checkbox for-each data
$scope.selectedRows = [];
$scope.itemGrid = {
checkboxHeaderTemplate: '<input class="ngSelectionHeader" type="checkbox" ng-model="allSelected" ng-change="toggleSelectAll(allSelected)"/>',
showSelectionCheckbox: true,
selectedItems: $scope.selectedRows,
multiSelect: true,
data : 'mainData',
columnDefs : 'mainColumn',
enablePaging: true,
enableColumnResize: true,
pagingOptions: $scope.pagingOptions,
currentMaxPages: $scope.currentMaxPages,
totalServerItems: 'totalServerItems',
showFooter: true,
}
angular.forEach($scope.selectedRows, function(item){
alert(JSON.stringify(item));
});