In the form linked below, I can't get one of the buttons to work correctly.
At the bottom of the form there is a table and on the far right a green + button. Clicking this button adds an update row. That row when it appears has a deletion button on the left (red with white "X"). If I click that deletion button it works fine. But if i create several of these update rows, clicking the delete button on the third instance deletes the first instance instead of the third instance. How do I fix this?
https://acrobat.com/#d=4mzuO1Pjz-0Z4ntuLZAy4w
Solved! Go to Solution.
Views
Replies
Total Likes
On the remove button you need to modify the parameter passed in the removeInstance.
removeInstance(this.parent.parent.index - 1);
when you simply state this.parent.index it is referring to Subform3 which there is only ever one instance. You are adding instances of Row1[1] therefore you need to go up one more level. this.parent.parent.index. Because you have are using Row1[1] then you need to use -1 as well otherwise is will be the wrong instance
If you had named each Row uniquely then you could use this.parent.parent.index (without the -1).
Views
Replies
Total Likes
On the remove button you need to modify the parameter passed in the removeInstance.
removeInstance(this.parent.parent.index - 1);
when you simply state this.parent.index it is referring to Subform3 which there is only ever one instance. You are adding instances of Row1[1] therefore you need to go up one more level. this.parent.parent.index. Because you have are using Row1[1] then you need to use -1 as well otherwise is will be the wrong instance
If you had named each Row uniquely then you could use this.parent.parent.index (without the -1).
Views
Replies
Total Likes
That works great. I never understood that concept until now thanks to you. Thanks for taking the time to help and educate.
~Don
Views
Replies
Total Likes