Need repeater with action column icons different than existing action column icons, for newly added row ONLY

I have an interesting question regarding a repeater and adding a new row. My repeater has ‘existing’ rows with an action column/cell with a PENCIL allowing the user to edit cells in the row for any ‘existing’ row. The row is initially in a VIEW state (not editable). When the PENCIL is clicked for the row then it changes to a SAVE icon and CANCEL icon and the row becomes editable. If they click the CANCEL icon then the action icon reverts to a PENCIL and the cell becomes uneditable again. If after clicking the PENCIL icon the user chooses to edit the row, they can. After updating values in the row the user clicks the SAVE icon whereby it changes back to a PENCIL, to note that the cell changes have been entered. The row reverts to a VIEW mode as well.

Here is a mock I created:
addrow_new-action-icon1.rp (1.2 MB)

I need a mechanism the same as above with a small change. What I need is a repeater with the ability upon adding a NEW row, the action cell needs to have not only a PENCIL but a TRASH icon so that users can DELETE any NEW row they add, if they wish, BUT NOT delete any existing entry so the action cell needs to show the PENCIL and TRASH icons ONLY FOR a NEWLY added row. If they update entries in the new row and SAVE the new row, the action cell icons revert back to ONLY a PENCIL, because after saving the new row becomes an ‘existing’ entry/row.

Any ideas how I would pursue this?

Well, the straightforward way would be to add a “New” column. Set it to “true” in your Add Row action and set it to “false” when Save is clicked (in an Update Row action.) In the OnItemLoad event, add a conditional case to show the trash can if [[Item.New]] is equal to “true”.

1 Like

Hmmm… makes sense. I will try that.

Here is my working file for anyone who wants to see.
addrow_new-action-icon2.rp (1.2 MB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.