angular-ui/ui-grid

Selected row count in grid footer not updated when rows deleted programmatically

Open

#4.100 geöffnet am 3. Aug. 2015

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.496 Forks)batch import
good first issuetype: bugworkaround

Repository-Metriken

Stars
 (5.395 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Deleting gird rows with gridOptions.data.splice does not update girdFooter selected row counts.

See http://plnkr.co/edit/a7GogUdI5nDUvc2KN1Rt?p=preview

Example is a fork of Tutorial: 210 Selection.

$scope.deleteSelected = function() {
      var rowsToDelete;
      rowsToDelete = $scope.gridApi.selection.getSelectedRows();
      if (rowsToDelete.length) {
        rowEntity = rowsToDelete[0];
        rowIndexToDelete = $scope.gridOptions.data.indexOf(rowEntity);
        $scope.gridOptions.data.splice(rowIndexToDelete, 1);
      }
   }

Steps to reproduce

  1. select row
  2. press 'Delete selected row' button, which fires $scope.deleteSelected
  3. footer still indicates deleted row is selected (selected row count does not decrement)

Before

plunker

After

plunker

Contributor Guide