Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Deleting the current table instance

Avatar

Not applicable

Hi

I am replicating table dynamically using

this.resolveNode('form1.#subform._subForm2').addInstance(1);

if (xfa.host.version < :smiling_face_with_sunglasses: {

    xfa.form.recalculate(1);

}

When I try to delete the current table instance using

this.resolveNode('form1.#subform._subForm2').removeInstance(this.parent.index);

if (xfa.host.version < :smiling_face_with_sunglasses: {

    xfa.form.recalculate(1);

}

results in always deleteting the first instance ( table )

Any help ?

I have a table with a button "Duplicate Table" and "Delete Table"

If user clicks on "Duplicate Table" it creates/replicates/duplicates the entire table with all the fields and the buttons.

Now from the user perspective suppose I have created/duplicated 5 tables with all the data fields and buttons ( please note each of the newly created table will also have their individual "Delete Table" option). Now I want to delete the third table using the "Delete Table" from the third table ( want to delete the same instance from which the button is clicked deleted .

0 Replies

Avatar

Level 8

Recheck your line:

this.resolveNode('form1.#subform._subForm2').removeInstance(this.paren t.index);

Replace this.parent.index with the name of the subform you are deleting. (ex: myParentTable.index);

or

Find how far down your delete button is in the hierarchy. For example if my delete button is wrapped in Subform1 and Subform1 is inside of TableToRemove then your syntax would have to be removeInstance(this.parent.parent.index) because the subform you want to remove is 2 parents up.

Kyle