Views
Replies
Total Likes
Views
Replies
Total Likes
I've been looking around for a solution myself, and have combined a few different methods and managed to work it out using a form variable and insertInstance() to insert a table row above the table row with current focus. I chose this method as I only wanted the one button on the form due to space limitations instead on having a button on each row, like with the 'Delete' row example on the Purchase Order sample.
Step 1 - Create a form Variable {File:Form Properties:Variables}, lets say 'nIndex' and assign it any number.
Step 2 - I added the following Javascript to the first row/ first column of my table on the 'Enter' event:
var xxx = this.parent.index;
nIndex.value = String(xxx);
If necessary this could be repeated for each row in the table.
Step 3 - I added a button to the form, basically anywhere will do, called lets say 'Insert Above' with the following Javascript on 'Click' event:
{table_name}._{row_name}.insertInstance(nIndex.value);
The '_' following the first period(.) is required.
Information:
I am using my form to document User Acceptance Test Script steps and needed the capability for the user to insert new steps as the script is being developed.
I also have another button 'Add Steps' which uses addInstance() to allow the user add rows to the bottom of the table for new steps.
NB: The same logic works for removeInstance to delete the row in the table with current focus.
Views
Replies
Total Likes