ListView Delete Button Issue: Deleting Corresponding Rows Instead of Last Row

I'm using a ListView to add checkbox trees. I want to add a delete button beside each row, so that when clicked, it deletes that specific row. However, I'm encountering a problem where it always deletes the last row instead. How can I ensure that the delete button deletes the corresponding row it's associated with?

Do you mind sharing your code so that we can suggest edits?

Generally I think you're going to want to pass an ID for that row to a function that uses findIndex and then remove the data at that index from your source.

Phong.json (20.8 KB)
Thank you. I tried using findIndex but it still doesn't work. Here is my code, please check and provide me with a solution. Thank you very much

Hi all!

One of my team members actually created an app that replicates this functionality! See the thread here. But he uses a combination of temporary variables and the splice method to target the specific row, and then update the listView row count!
‚Äč