Removing Rows

rickstsx04

02-09-2015

I have a question about deleting rows. I created a table that allow a user to add or delete rows. I added a delete button on the row that I would like to duplicate. This button cannot delete the row that it is contained in. Is there a way that the delete row button can delete the row that contains it as well?

Accepted Solutions (0)

Answers (3)

Answers (3)

radzmar

MVP

13-09-2015

Hi Ricky,

yes this is possible, !

Assuming your table "MyTable" has repeated rows "Row" with a textfield "Name" the script in you add row button would look this way:


// Add 1 row
MyTable._Row.addInstance(1);


// Set focus on textfield in newly added row


xfa.host.setFocus(xfa.resolveNode("MyTable.Row[" + _Row.count - 1 + "].Name").somExpression);


rickstsx04

09-09-2015

Hello Radzmar,

Thank you for the sample pdf, it was a big help! I have another question. Is there a way to setFocus on the first field in the newly created row when the add button is clicked?

Thanks,

Ricky