Adding edit and delete buttons for each row in the perspective table

Hi everyone,
I have a table which represents data from a query. I would like to add edit and delete buttons for each row in my table as the table in the figure below.

I also want to do some actions with these buttons. When a user clicks the edit button in each table row, it will trigger an event such as onCellEdit for example.

Thank you for your time!

Isn’t it enough to use queries in the onActionPerformed event of those buttons ?
Maybe trigger a refresh of the table afterward if it doesn’t update, but I can’t see why this would not work.

If the other actions you have in mind can’t be done from that same event handler: why not ? What issues did you run into ?

edit: Maybe you only want to remove the row in the display table, not in the database ?

Yeah, there are many things that we need to handle. I am not sure that I can answer all your questions now. However, I want to make a responsive table like a HTML table in the normal website. When a user clicks edit/delete button, it will update both UI and database.

I don’t know if you can put buttons or symbols in a table, but if that’s not possible you can easily make a flex repeater with your buttons/icons right beside your table, based on its length.

Then, you can add a script on the onActionPerformed or onClick event of your buttons, with your SQL queries and the logic you need to handle.
To target the right database table entry, you can have its primary key associated to the row in the display table, without it actually being displayed. Then you can just reference that in your query.
If you’re wondering how to target a specific row in the case where your buttons are in a separate flex repeater, you can match the instance number of the flex repeater with the display table row.

There might be simpler solutions, I never had to do something like this, but from the little I know of Ignition this should work and be easy enough to implement.

1 Like