Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Inserting a new row between existing table rows

Avatar

Former Community Member
Apologies if this has come up before (though I have searched through the forum), but does anyone know whether I can create a button to insert a new row immediately below any particular row in a table. The alternative at the moment (if I want to insert additional info into the table) is to add another row at the bottom of the table and then cut/paste the contents above and shift it all down field by field.

Any ideas?

Many thanks
2 Replies

Avatar

Former Community Member
Yes, it's possible, you need to know the instance of the subform you want the new one to be below. Your script would look something like this:



var newIndex = indexOfSFToBeBelow + 1;

subform.instanceManager.insertInstance(newIndex, true);



Chris

Adobe Enterprise Developer Support