Expand my Community achievements bar.

remove rows at multiple tables

Avatar

Level 3

How do i remove a row on multiple tables with one button?

var rowIndex = this.parent.index;

Table1.Row1.instanceManager.removeInstance(rowIndex)

Table2.Row1.instanceManager.removeInstance(rowIndex)

That doesn't work when ik add the script above to a button on Table1

Only the row on Table1 is deleted, but i get an error message for the second table

2 Replies

Avatar

Level 10

Hi,

Have a look at this example: http://assure.ly/eTOXaH, in particular the script in the delete row button.

I would tend to use the shorthand for instanceManger (_), which will not thow an error if there isn't a row instance to refer to.

Table1._Row1.removeInstance(this.parent.index); 

In relation to Table2, is this on a different page? If so, then you would need to include that in the relative reference.

Hope that helps,

Niall

Avatar

Level 3

Table2 can be on page 2, 3 or 4.

That's the problem.

But i found a solution by adding a button to Table2 and perform an .execEvent("click") on that button.