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

**URL:** <https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 3, 2021, 10:56am UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661 "2021-11-03T10:56:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![phandc](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phandc](https://forum.inductiveautomation.com/u/phandc)\
**Post date:** [November 3, 2021, 10:56am UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/1 "2021-11-03T10:56:08Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/2/f26fba402d2fb88b8e625316273b36443bed0e92.png)

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!

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 3, 2021, 11:10am UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/2 "2021-11-03T11:10:26Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![phandc](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@phandc](https://forum.inductiveautomation.com/u/phandc)\
**Post date:** [November 3, 2021, 4:19pm UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/3 "2021-11-03T16:19:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 3, 2021, 4:46pm UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/4 "2021-11-03T16:46:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [June 3, 2026, 7:23pm UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/5 "2026-06-03T19:23:56Z")

</div>

So how do we add the buttons to the table rows? If the gateway is perspective... they have buttons in those tables. How do we do this?

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [June 3, 2026, 8:41pm UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/6 "2026-06-03T20:41:22Z")

</div>

Put the icons in an embedded view for the Actions column. The view will automatically have a `rowData` parameter that contains all the values for the row, which you can use to edit or delete the entry when the icons are clicked. Then use `system.perspective.sendMessage()` to indicate that the data has changed, so the table can refresh its query.

The row data should contain a primary index that can be used to look up the entry in the database, which may not be something you want shown in the table itself. You'll need to make sure that it is present in the table's `columns`, so that it shows up in `rowData`, but you can toggle its visibility.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [June 4, 2026, 1:34pm UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/7 "2026-06-04T13:34:23Z")

</div>

Thank you, where in the properties do I add these values on the table component? Have you done this? Any chance you could screenshot the properties of the sub view parms and the table component properties ...

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [June 4, 2026, 1:47pm UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/8 "2026-06-04T13:47:46Z")

</div>

So I have a view defined for a "priority" column of a table:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/f/1ffc9d6dff917d75911d9ef1394610a8ed448c69.png)

Then the view itself references `rowData` to get the `priority` property:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2b383da8dbac9c6b7b2010cb8b1cabf88a190395.png)

You would put your icons in such a view, and make use of whatever primary key column exists for that table's row (assuming the data comes from a DB query) to either delete that entry from the table, or open a popup that lets you edit it.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [June 4, 2026, 2:16pm UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/9 "2026-06-04T14:16:55Z")

</div>

I still just don't know how to pass the Row index to the sub view. So if the sub view had a rowIndexParm... how would I bind the row Index to this button view's rowIndexParm ?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/8/1852bcd8da3de3ba29da447053115f36b8b2cb15.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/0/60e7dff8bd3bc90bc9f8228475d5f1db7db9f010.png)

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [June 4, 2026, 2:25pm UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/10 "2026-06-04T14:25:27Z")

</div>

That would be the primary key I mentioned. Assuming the table row is a representation of a DB row, then that row would have an indexed key that can be used to reference it. You have to include that key in the table's `columns` so that it shows up as a property of `rowData` in the view. In most cases it's probably not something you want actually showing in the table, so you can set its column to `visible: false`.

From your screenshot, it looks like the view can reference `rowData.Id`.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [June 10, 2026, 1:09pm UTC](https://forum.inductiveautomation.com/t/adding-edit-and-delete-buttons-for-each-row-in-the-perspective-table/52661/12 "2026-06-10T13:09:42Z")

</div>

This should be marked as answered. I had the same request as OP. I would have started my own thread, but this was already here.
