Skip to content

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

Open
@louspringer

Description

@louspringer

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions