Tejashri Patange
Tejashri Patange

Reputation: 339

ag-grid header checkbox selection event

Just want to know whether we can distinguish between all row selection and individual row selection in ag-grid(via header checkbox selection). Is there a method or property associated with ag-grid to tell this difference?

Upvotes: 0

Views: 10129

Answers (2)

Nimisha Jain
Nimisha Jain

Reputation: 3

Just listen to selectionChanged event at grid level to apply some action per selection changed by column header checkbox

Upvotes: 0

ViqMontana
ViqMontana

Reputation: 5698

Yes you can. The ag-grid api offers some useful methods:

this.api.getSelectedRows() will get you all the selected rows.

this.api.getDisplayedRowCount() will get you all the rows displayed.

If these 2 equal each other, then the user has selected all the rows.

Ps. the api is a of type GridApi, which is initialised from the gridReady event exposed by ag-grid.

Upvotes: 1

Related Questions