Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Tables with buttons to add rows

Avatar

Former Community Member

Morning

I am having trouble with a table that has buttons to add, show and hide rows.  There are 2 rows in my table which I need to be able to add depending on which button is clicked.  I've managed to get the first button to add an instance using (Table.Row1.instanceManager.addInstance(1);) but I can't get row 2 to add to the bottom of the table with a button.  I've tried to amend the script to fit the second row but it doesn't work.

Table.Row2.instanceManager.addInstance(2);

I'd appreciate some help

I can send a sample if need be.

Many thanks

Ben

1 Reply

Avatar

Level 10

The correct syntax is addInstance(1) (or addInstance(true)).

As long as the row is set to repeat (Object>Binding>Repeat Row for Each Data Item) it should work. If the row doesn't exist yet then try using the underscore shortcut for the Instance Manager: Table._Row2.addInstance(1);