I have a repeat region using the accordion cards component. I would like to be able to click on each card individually and toggle a dynamic collapse for the one card. Instead all of the cards toggle. This is because they all have the same ID, so accordion1_collapseOne.toggle() opens all of them. How can I have a dynamic ID instead so I can open each card individually?
Click Dynamic Attributes and choose Name. Then for the Value you choose the $index under the Repeat. Once you have done that, go into code view and change dmx-bind:name= to dmx-bind:id=
I think your button should look like this: <button class="btn btn-primary" dmx-on:click="toggler.setValue((toggler.value == -1 || toggler.value != $index) ? $index : -1)" dmx-show="omschrijving!='<p><br></p>'">{{Username}}</button>
But modified for collapse of course
I’m running into a similar situation except with a checkbox repeating group that’s populated from the DB by a server connection:
The issue is that the ID for the repeated group is duplicated. In this case, only Test1 should be checked off. When I edit the HTML in the Chrome Inspector and make the ID unique it works correctly.
The question is, how to do the same thing in Wappler. I am guessing I need to enter the dynamic ID on the Custom Checkbox repeating group element, but not sure how to do that or whether that’s even close to correct.
The solution should be the same concept. You first need some unique ID (either $index or primary key on your db). I don’t know exactly which dynamic attribute can trigger a check box but this should be possible.