After Every Add or Delete in Database, update text()

https://pastebin.com/PdcdSq6K
I would like to update the total costs and total amount every time an add, delete, or update operation occurs. idk how to do this. I tried to do it with the add event listener, but it didn’t work

I was also wondering which was better, the CrudUI component I’m using now or the native grid/crud component