Expand my Community achievements bar.

Dynamically change the hierarchy of subforms

Avatar

Level 2

Hi,

I've been searching on the Web for days to find an answer to my question, but I couldn't find anything relevant.

Basically, what i'm trying to do is to change the hierarchy of my subforms using javascript. I readed about the "subforms sets", but I really don't know if we can use it with javascript (I didn't find any references).

I'd really appreaciate if someone could help me out on this.

Thanks and have a good day

2 Replies

Avatar

Level 7

Why are you wanting to dynamically change the hierarchy of subforms? I've never run across a situation what would require me to do this, so I'm VERY curious about why you would need to. Can you give an example of what you're trying to do? Even if the hierarchy thing isn't doable, maybe there's something else you could do to get the same result.

Avatar

Level 2

Hi,

Okay, i'll simplify my exemple to be clear.

1. I have a dropdown list with 3 items : Subform 1, Subform 2 and Subform 3.

2. I can also duplicate this dropdown list with the InstanceManager.InsertInstance fonction with a "Add" button.

3. I have 3 different subforms hidden by default (which are named Subform 1, Subform 2 and Subform 3).

If my first selection in my dropdown list is Subform 2, I want the Subform 2 to show first. Then, I can click on "Add" to make another selection in my second dropdown list and choose "Subform 1" and finally, add one last dropdown list and select "Subform 3".

The result I wanna see is Subform 2 first, Subform 1 second and then Subform 3. So basically, I wanna show my subforms depending on the selected order in my dropdown lists.

The next step would be to have the possibility to create more than one Subform 1, 2 or 3 and have them placed in the dropdown list order (so I can select each subforms more than once).

One more thing. I don't wanna create a master subform which will regroup my Subform 1, 2 and 3 and then duplicate the master to only show the selected subform in my dropdown list because I have alot of scripts on the calculate event and in my real form, I have like 13 different subforms so it's going to be laggy.

I hope I was clear enough, sorry if my english is messy, i'm a french Canadian

Thanks and have a good day.