Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Remove last row in table

Avatar

Level 2

I have a form that I allow the user to determine how many rows will be displayed in a table.  I am using a drop down list and use the following code. I would like no table rows to display when zero is selected but the last row is always displayed even when zero is selected.  How can I remove the last row.

var iRows = xfa.event.newText;

if (iRows == "0") {

    //What code should go here

}

else {

    TextField1.rawValue = iRows;

    TrainingReport.TrainingTable.TrainingData.instanceManager.setInstances(iRows);

}

2 Replies

Avatar

Level 10

Hi,

Make sure you removed the Check Mark for the Minimum instances of the row in the binding Palette.

Avatar

Level 2

I got that to work just using this code in the change event of the drop down list and changing the settings of the table. 

var iRows = xfa.event.newText;

TravelPlans.TravelTable.TravelRow1.instanceManager.setInstances(iRows);

Now my problem is once I select 0 (zero) from the list and the last row is removed, It will not reappear when I select any other number.