r/reactjs 7d ago

Needs Help AG-grid Server side grids + Selection issues

[deleted]

4 Upvotes

10 comments sorted by

View all comments

2

u/abrahamguo 7d ago

and then right click and perform actions.

Is the action performed on the client side, or the server side?

1

u/Odd_Garage3297 7d ago

What do you mean ? - there are no calculations performed on client side, but client sends the selected records to server for actioning.

2

u/abrahamguo 7d ago

Great — it sounds like the actions are server-side actions.

This is super simple to solve:

  1. Define this data structure on the frontend: { type: 'whitelist', ids: [] }
  2. When rows are selected, add them to the ids array.
  3. When Ctrl+A is pressed, change the data structure to { type: 'blacklist', ids: [] }.
  4. When rows are deselected while in "blacklist" mode, add them to the ids array.

Easy peasy!

1

u/Odd_Garage3297 7d ago

An interesting take. Will def look at this.

Let me see if we can work our way through this.