angular-ui / ui-grid

UI Grid: an Angular Data Grid
http://ui-grid.info
MIT License
5.39k stars 2.47k forks source link

Selection checkbox in ui-grid auto selecting on scrolling angularjs #7083

Open piyush21upadhyay opened 4 years ago

piyush21upadhyay commented 4 years ago

ui-grid checkboxes which are used to select a row automatically gets checked on scrolling. On scrolling fast up&down some checkboxes auto getting select even though row is not selected.

ui-grid version used is 4.6.2

Below is the grid-options of grid:

vm.gridOptions = {
    enableSorting: false,
    infiniteScrollRowsFromEnd: 40,
    infiniteScrollUp: false,
    infiniteScrollDown: true,
    enableRowSelection: true,
    enableSelectAll: true,
    multiSelect: true,
    enableColumnMenus: false,
    enableFullRowSelection: false,
    enableSelectionBatchEvent: false,
    enableRowHeaderSelection: true,
    enableCellEditOnFocus: true,
    treeRowHeaderAlwaysVisible: false,
    treeIndent: 20,
    showTreeExpandNoChildren: true,
    showTreeRowHeader: false,
    enableColumnResizing: true,
    //selectionRowHeaderWidth: 35,
    rowHeight: 40,
    enableHorizontalScrollbar: uiGridConstants.scrollbars.WHEN_NEEDED,
    columnDefs: [
      { name:'id'},
      { name:'name' },
      { name:'age' }
    ],
    data: 'data',
    onRegisterApi: function(gridApi){
      gridApi.infiniteScroll.on.needLoadMoreData($scope, getDataDown);
      //gridApi.infiniteScroll.on.needLoadMoreDataTop($scope, getDataUp);
      vm.gridApi = gridApi;

      gridApi.selection.on.rowSelectionChanged($scope, function() {
        // Here performing some logic to enable/disable some actions based on selection count
      });
    }
  };

Grid.html

<div ui-grid="$ctrl.gridOptions" class="grid"
    ui-grid-infinite-scroll
    ui-grid-resize-columns
    ui-grid-auto-resize
    ui-grid-selection
    ui-grid-edit 
    ui-grid-exporter
    ui-grid-row-edit
    ui-grid-cellNav 
    ui-grid-save-state></div>

uzT3E

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically closed because it has not had recent activity. If you believe that this is still an issue in the latest version, feel free to re-open it. Thank you for your contributions.

sapnildessai commented 3 years ago

Hi @mportuga , We are facing this is same exact problem with v 4.9.0 version of the grid. Could you please help us here? Thanks

mike2011lp commented 3 years ago

We are facing something similar.

When scrolling some rows are randomly selected.