Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

List table rows alphabetically

Avatar

Level 2

I have a table set-up to repeat rows using the instance manager.

I know how to number the rows numerically, but what I'd like to do is to list the rows alphabetically, A. B. C. D. etc.

Does anyone know how to do this?

2 Replies

Avatar

Level 6

Use something like this in the indexChange event for the row (javascript):

this.Cell1.rawValue

= String.fromCharCode(this.index + 65);

65 is the ASCII code for "A", so you're just incrementing the letter using the current index.

Avatar

Level 2

Kevin,

I had to tweak it a bit to get it to do exactly what I wanted, but this is what I came up with and it works great.

this.Cell2.rawValue = String.fromCharCode(this.parent.index + 65)+".";

I put the script under "calculate" for the table cell and it numbers the first and all consecutive rows as A., B., C., D.,and so on.

Thanks for you help!