Hi there, I’ve created a practice planning app for basketball coaches that populates a repeating group when something is selected from a list of dropdowns. The repeating group shows a custom state that is a list of the drills that are selected from the dropdowns. {shown below}
I’m assuming this is sorting by the list number, shown here:
Basically, when something is added to the custom state, its list # becomes 1, and everything else goes up by a number, so it is sorting in the repeating group in the opposite way I want it to. If I choose something first, I want it to stay at the top of the repeating group, as if I was making a grocery list.
Can anybody help here? Seems like it should be simple, but I can’t figure it out.
I’m still lost on this sorting issue. It seems like it should be so easy, and it used to work properly. I essentially just want the repeating group to list the items I select from top to bottom (first item i select is at the top, last item i selected is at the bottom), instead of bottom to top (like it’s currently doing). Surely I’m making this more complicated than it needs to be?
Ok, I see. You’re adding things to a Custom State, not to the DB. I’m not really familiar with dealing with Custom States as lists, so I’m not sure how much help I’m going to be, unfortunately.
Why are the drills not added to the Practice Plan directly?
That’s very possible to be true, I’m not sure. I tried to do some of the sorting options on the custom state, but I couldn’t get it to listen to me. I’m not really sure what the logic is it works by. Sorry I’m not more help!
@andrewgassen no prob! I appreciate you taking a look! I created a practice-plan-test page and have them adding to the practice-plan as soon as they’re chosen. Still trying to figure out the sorting logic, though.
I switched up my logic and no longer am using a custom state. I’m having the items be added to the practice plan ‘thing’ as soon as they’re selected in the dropdowns. The repeating group has a source of ‘user’s practice plan’ and that’s all working well.
How would I be able to have a user be able to move drills. I have an ‘X’ where they can remove them from the list, but not sure how they’d be able to move them up and down?
You could put a slim drop area in the gap of each list item and have the user drag an option over them. If say drop area 2 is dropped on then all list items with position > drop area slot number is now there position + 1, dropped option gets drop areas position + 1. Then reversed rules for remove an option.