hvglcs
hvglcs•15mo ago

How can I delete a row in the AgGrid table?

While defining columns for table, i added a "Delete" button, when i click this button, i want to delete the currently selected row. How can i do this? . Thanks so much
No description
No description
6 Replies
Sindre
Sindre•15mo ago
Make the table based on state. Like state.rows. when you click deleted run a frontend script that sets a new state.rows without the row
hvglcs
hvglcs•15mo ago
So, I have to run a background runnable to listen for that change (in state), and then I will call an API to delete it in the database (I'm using Supabase)
Sindre
Sindre•15mo ago
Yeah so if you want to persist it to a database. You could run a background task to deleted it from the database then rerun the original query that fetches this state.
hvglcs
hvglcs•15mo ago
Yep, I have an off-topic question, hope you can help me. Where should we store the access token? In the state?
Sindre
Sindre•15mo ago
I would check out the hub for good examples of how to do things. You can run supabase as a frontend Script directly as a background worker not exposing the supabase auth. https://hub.windmill.dev/integrations/supabase/apps
hvglcs
hvglcs•15mo ago
Thank you very much 🥰