Hey guys,
I am struggling to save the new order into the Database after reordering via Drag&Drop Repeating Group plugin (or any other). Basically I have a repeating group of Milestones and on page load all 5 Milestones have Order from 1 to 5.
I want to update them each time the user will reorder them. I was playing around with Simple Looper plugin to “Make Changes to Milestone” and update the Order but I am stuck at this point.
I thought it should be just “Order = This Simplelooper’s Current iteration number” but that just add same order 1 to 5. The loop is working cause I tried updating other fields.
Other topics on the forum wasn’t helpful.
Anyone?
hey @ZeroqodeSupport I am tagging you cause I am using your Drag&Drop Repeating Group plugin
you have to save it as a list on a data
the way I normally do this is with intermediary states
get original list
send to custom event
get items above dropped group index
save as state
get items below dropped group index
save as state
get above list plus moved object merged with below list
save on data or state
often I’ll hold the reorder as a state until the user “saves” it with a button click - saves writing to the database frequently as users will shuffle rows regularly.
I also use 2 drop groups to better position whether the user dropped above or below the row and then highlight when dragged over to indicate whether it’ll go above or below.
another way to do it is to use a number on the data and just get the number above and below then divide in half and write the number on the data and then sort by the number. it’s messier but you don’t have to store a list on a data. I usually cleanup the numbers when the user clicks save if I use that method (otherwise you end up with a lot of decimals from the divisions)
1 Like
Hi @alanpodemski,
Thanks a lot for reaching out to us about using our plugin. We really appreciate it
Could you please take a look at the suggestion provided by @mitchbaylis and see if it helps you? If this suggestion doesn’t work for your use case, could you please provide us with more details? This could include how you set up the database, the repeating group, and any other relevant information!
Best regards
Browse all Zeroqode Plugins for Bubble