How do I enable a reapeat within a repeat without adding a variable for each child repeat?

HI @sid

I have a quick clarification.

When trying to get the Question (parent) $index and add it to the child Answera to bind it to the name this doesn’t work currently work:

{{$parent.$index}}

Is there a way of grabbing the parent index?

Something like this

dmx-bind:name="answerParent{{$parent.$index}}

Much appreciated!

Ah. Forgot to check if that worked. I just put it in to test.
It does not work.

Here’s a workaround:

<dmx-value id="varAnswerCount" dmx-bind:value="1"></dmx-value>
<dmx-value id="varQuestionIndex" dmx-bind:value="$index"></dmx-value>

Add another variable to store the question index. Then bind id/name with that.

<input id="textAnswer" dmx-bind:id="textAnswer{{varQuestionIndex.value}}{{$index}}" name="textAnswer[]" type="text" class="form-control">
1 Like

Hi @sid

Works well and now I know how to add Variables inside repeats.

And I am sure others will find this thread very handy!

Kudos to @Antony @Teodor and @sid

1 Like