Hi guys,
I got a task to build a Form with a subform. By clicking a button ("add" or "+") another subform of the same kind is created underneath and one button that removes the subform in wich it is placed (via removeInstance(this.parent.index)). That works pretty well. Now I am supposed to move the subform up and down with one button for each:
This too works. But the next task doesn't work. According to the position of the subform, the moving buttons are a) both there (for subform 2 to max-1), b) only move down (subform 1) and c) only move up (for subform max). After they are moved it should check again every subforms position and according to that position it shall hide a button (if it is moved to first or last position) or show them again (if moved from first or last position).
Here are some information on the names of subforms etc. and a first attempt by myself:
With this code the "move up" button of the first subform is hidden after opening the doc but after moving it down the "move up" button won't appear again.
I am quite clueless about what to do so maybe one of you can help me with that.
Thank you!