Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

How to create a "Remove current page button"

Avatar

Level 2

I have a button that removes the page. However, it's removing the first

page. How can I change this to remove the "current page"?

2 Replies

Avatar

Level 10

removeInstance method takes an input arument of the index of the page you are trying to remove. So pass the current page's index to the method..

     instanceManager.removeInstance(index);

Thanks

Srini

Avatar

Level 2

This is what's on the form:

var

i = this.parent.instanceIndex;

if (i == 0) {

if (form1.page.instanceManager.count > 1) {

form1.page.instanceManager.removeInstance(0);

}

}

else {

i = i + 1;

form1.page.instanceManager.removeInstance(i);

But this one is removing the first page. Can you take a look at it and make correction to this code?

Thanks!