Expand my Community achievements bar.

Add Row and Delete Row Buttons

Avatar

Level 4

Hello:

I've created a form that has the Add Row and Delete Row buttons in a table that calculates.  I have two questions, 1)  Is there a way to have the AddRow and DeleteRow buttons only appear once at the start of the table? or, 2) is there a way to make the AddRow and DeleteRow work in the whole table so that users don't have to go to the beginning of the table to delete a row or add a row?

Thanks for any assistance on this.

Connie

1 Reply

Avatar

Level 3

Connie,

For question 1: Yes, and no: you can locate the "add" button anywhere you would like. However, the "delete" button should be within the row you want to delete so that you delete that specific row. The add button will add to the end of the table and I have never been able to get it to add between fields; so placement of this doesn't matter. The syntax of the add button is simply a click script with:

TableName._Row you want to repeat name.addInstance(0);  (this is javascript). Example, Table name = Table1 and row name = calc

Table1._calc.addInstance(0);

For question 2: What I typtically do is create an extra column at the left and right of the table. In the left most column I add a button with caption"+" to signify adding a row. In the right most column, another button with caption "x" to signify deleting. The beauty of this method is that the add and remove buttons are on every cell so the user can access them. Plus, the remove button will remove specifically that row. The scripting is again a click:

TableName._Row you want to delete name.removeInstance(this.parent.index)          (this is formcalc) Example, Table name = Table1 and row name = calc

Table1._calc.removeInstance(this.parent.index)

I hope this helps,

Mallard27