Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在ng网格中获取选定行id(AngularJS)_Angularjs - Fatal编程技术网

如何在ng网格中获取选定行id(AngularJS)

如何在ng网格中获取选定行id(AngularJS),angularjs,Angularjs,我希望删除选定的行。因此我希望获得选定的ID $scope.gridOptions = { data: 'myData', enablePaging: true, showSelectionCheckbox :true, resizable :true, showFooter: true, multiSelect: true, selectedItems:$scope.mySelections, totalServerItems:

我希望删除选定的行。因此我希望获得选定的ID

 $scope.gridOptions = {
    data: 'myData',
    enablePaging: true,
    showSelectionCheckbox :true,
    resizable :true,
    showFooter: true,
    multiSelect: true,
    selectedItems:$scope.mySelections,
    totalServerItems:'totalServerItems',
    pagingOptions: $scope.pagingOptions,
    filterOptions: $scope.filterOptions,
    afterSelectionChange: function () {
      $scope.selectedIDs = []; 
      angular.forEach($scope.mySelections, function ( item ) {
          $scope.selectedIDs.push(item.ID);
      });
    },
columnDefs: [
               { field: 'iSchl_Id', displayName: 'ID' },
               { field: 'vSchl_Name', displayName: 'School Name' },
               { field: 'vCity', displayName: 'City' },
               { field: 'vState', displayName: 'State' },
               { field: 'vCountry', displayName: 'Country' },
               { field: 'vEmail', displayName: 'Email' },
               { field: 'iStatus', displayName: 'Status' },
       { field: '', cellTemplate: '<button ng-click="edit(row.entity)" title="Edit" class="icon-edit edt-btn"></button><button ng-click="delete(row.entity)" title="Delete" class="icon-trash dlt-btn"></button>',displayName: 'Action'}
    ],
};
$scope.deleteall = function() {
     var verify=confirm('Are you sure to want this delete all selected record?');
      if(verify==true)
      {
           //Please give me logic of selected ids
      }
    };