Hi all,
Big part of my app im moving to native is drag and drop (currently using DragIt for web)
Any ideas how i can move an item in a list to the + or - list index and save it?
Its the main thing stopping the app from launching.
Thanks
Chad
Hi all,
Big part of my app im moving to native is drag and drop (currently using DragIt for web)
Any ideas how i can move an item in a list to the + or - list index and save it?
Its the main thing stopping the app from launching.
Thanks
Chad
Hey @chaddickson83,
Add a position field (on the DT) for each item in the list, and then display the list sorted by position (descending = no). And then when a user wants to move the items, just swap positions accordingly.
For reference, consider the following items;
Now if a user highlights Titus (position 3) to move upwards to position 2, the the logic steps would be;
Although, this may run into race conditions on very few occasions, and so, as an addition, you may want to force the operations by referencing the previous step (step 2 ref step 1) OR even block user action immediately they tap a button so they don’t do so twice and double-trigger the event.
Hope it helps.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.