loopIndex would be the current 'round' of loop. So if we for example have a for loop that repeats 5 times it would work like this:
for 1 to 5
.. append loopIndex to text
Text would read: 12345 after the for loop would have finished running, adding a number each 'round' the loop does.
What this allows us to do with arrays, we can for example go through each row with loopIndex. So the same for loop with array could work something like this:
for 1 to 5
.. append array.at(loopIndex) to text
After the loop text would read whatever was contained in array values 1 through 5. I'll try to expand on that example a bit tomorrow if I got time, to make it easier to understand. :)
In your case, you could just add rows 2-13 to the part where text is displayed (the on click event). I'll expand the example with this when I got some more time :)