How can this be done with repeats

I have a query that returns:
all_modals = all modal names and id
query1 = modalID that is filtered by the memID

What I need to achieve is:
all_modals (repeated, to show all buttons)
then change the button colour (ban-success) if the query 1 has the same id as all_modals
This kind of works when I add:
dmx-class:btn-success="(serverconnect2.data.query1[0].tra_moduals_autoID == autoID)"

However it only changes the first one because of the [0].
If I remove the [0] then it just does not work

Do any of you smart people have any ideas on this, as its driving me crazy.

Link to the test page: https://club.plwebdesign.com.au/test.php

If you change the 0 to $index you may find it works. This returns the index of the repeat in place of the 0 so should then work correctly for all buttons in the repeat.

I’ve done similar with badges, not in front of a computer right now but can copy the code later if not?

4 Likes

You Sir are an absolute legend…thank you :slight_smile: