how to apply selectAll and deSelectAll to the header checkbox in ag-grid react

anik4404

I have added checkboxSelection to my first column and also the headerCheckBoxSelection.

columnDefs: [
  {
    minWidth: 45,
    maxWidth: 45,
    headerCheckboxSelection: true,
    checkboxSelection: true,
    lockPosition: true,
    hide: selectedHeaders.length === 0 ? true : selectedHeaders.includes('Name')
  },

But the header checkbox for select and deseltall doesn't work. I've added two callbacks for selectAll and deselectAll but I'm not sure where to add these callbacks so that I can select and deselect all rows:

const deselectAllHandler = useCallback(() => {
 gridApi.deselectAll();
}, [gridApi]);

const selectAllHandler = useCallback(() => {
 gridApi.selectAll();
}, [gridApi]);

I'm able to select individual checkboxes and retrieve the selected rows, but not able to select all and deselect all

enter image description here

Thanks in advance!

anik4404

My Apologies, The Grid component I have been using was a shared component and someone had the mouse click disabled on that checkbox. So, this property headerCheckboxSelection: true is enough to allow select and deselect all.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

ag-grid header checkbox selection event

How to add selectAll/deselectAll buttons on top of clrCheckbox?

AG-GRID-ANGULAR - How to check/uncheck checkbox in header component if all checkboxes in the cell renderers are checked/unchecked?

React - custom styling ag grid header

How to add a column header below an existing column header in ag-grid for react

How to apply filter to a cell renderer in ag grid

How to show total in ag-grid header

How to add a select-all chekbox to Column Header in Ag-Grid React?

selectAll() and deselectAll() for checkboxlist causing issue

How to use a checkbox for a boolean data with ag-grid

How to align the checkbox and text in cell to center in ag grid angular

How to change boolean data with checkbox in ag-grid?

UI-Grid - How to select records displayed in the current page using selectAll checkbox

How to apply custom css class in ag-grid cell in angular?

How to apply ag-grid custom filter when clicking a button

How to set style on a specific header in ag-grid

How to wrap column header in ag-grid using angular

In ag-grid how to get dynamic header name?

Ag-grid Angular How to get click events on Header?

How to sort column in AG-Grid with empty Header Name

How to align ag-grid-angular header dynamically

How to translate ag grid header using ngx-translate

Only select rows from current page using checkbox on header in Ag-grid

Ag-grid sticky header

Disable SelectAll and DeselectAll from Bootstrap-Select

Remove checkbox from rows in ag-grid

group selection & checkbox in ag-Grid

disable checkbox selection in Ag-grid

Ag Grid Call a function on click of checkbox

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  3. 3

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  4. 4

    pump.io port in URL

  5. 5

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    Do Idle Snowflake Connections Use Cloud Services Credits?

  9. 9

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

  10. 10

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  11. 11

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  12. 12

    Generate random UUIDv4 with Elm

  13. 13

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  14. 14

    Is it possible to Redo commits removed by GitHub Desktop's Undo on a Mac?

  15. 15

    flutter: dropdown item programmatically unselect problem

  16. 16

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  17. 17

    EXCEL: Find sum of values in one column with criteria from other column

  18. 18

    Pandas - check if dataframe has negative value in any column

  19. 19

    How to use merge windows unallocated space into Ubuntu using GParted?

  20. 20

    Make a B+ Tree concurrent thread safe

  21. 21

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

HotTag

Archive