Hi,
I'm creating a table where the first column in a row is automatically numbered. When a 'row' new instance is created (using Action Builder in ES2) the first cell in the table should automatically ascend.
I've figured out how to do this with numbers - (this.rawValue = (this.parent.index + 1);) but i have a table where i want to use letters of the alphabet instead. (I.e. A,B,C etc.) Is this possible?
If it helps, the maximum amount of rows in the table is 4. (D)
Cheers
Rob
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Rob,
On the right track. If you create an array with the alphabet, then the script would access the appropriate letter, depending on the row number.
Sample here: https://acrobat.com/#d=Zk2XWWDUWNfG*VuRTNy5QQ
Also the script is in the layout:ready event, so that if rows are deleted, all indices will be updated.
Good luck,
Niall
Views
Replies
Total Likes
Hi Rob,
On the right track. If you create an array with the alphabet, then the script would access the appropriate letter, depending on the row number.
Sample here: https://acrobat.com/#d=Zk2XWWDUWNfG*VuRTNy5QQ
Also the script is in the layout:ready event, so that if rows are deleted, all indices will be updated.
Good luck,
Niall
Views
Replies
Total Likes
Awesome! Exactly what i needed.
Thanks a lot.
Rob
Views
Replies
Total Likes
> (this.rawValue = (this.parent.index + 1);)
this.parent.index + 1 will yield the same result. No need for the rawValue assignment.
Views
Replies
Total Likes
Hi Iakov,
I agree this.parent.index + 1 will work in a calculate event, but in this case the calculation will not automatically update when a row is deleted.
When used in the layout:ready event you need to give the full calculation $ = this.parent.index + 1 (FormCalc) or this.rawValue = this.parent.index + 1; (JavaScript).
In both cases this will give a numbered index that will update in real time as rows are added and deleted. The use of this approach also helps when using buttons to move rows up and down the table.
The script in the example was a little more involved because we were using the index value to access an array.
Thanks,
Niall
Merci.
Views
Replies
Total Likes
Très bien...
Views
Replies
Total Likes
Views
Likes
Replies