You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I Have two containers, A and B, containers B is empty and I want to choose one item from container A and drag it inside.
Container B can only have one item inside, so therefore I either want to swap the item being dragged with the item already in the container or I want to revert on pull so that no item is dragged into container B but the onEnd event still fires.
I am using a framework which means that the text of container B is bound to the object I am creating, so I don't need the dragged item to stay in place.
So in my lil app I am creating an appointment, I have a list of doctors and a list of patients, and the appointment with a placeholder for each, but when I drag I can keep on adding to the placeholders.
I can create a CodePen if that will help illustrate.
Thanks
The text was updated successfully, but these errors were encountered:
You might be able to use onMove on Container A option to your advantage.
When dragging an item to container B, you need to check if it's container B and if >= 1 elements exist, return false from the onMove function.
That will mean that the item will not move to Container B and it will work as you please.
Hello chaps.
I Have two containers, A and B, containers B is empty and I want to choose one item from container A and drag it inside.
Container B can only have one item inside, so therefore I either want to swap the item being dragged with the item already in the container or I want to revert on pull so that no item is dragged into container B but the
onEnd
event still fires.I am using a framework which means that the text of container B is bound to the object I am creating, so I don't need the dragged item to stay in place.
So in my lil app I am creating an appointment, I have a list of doctors and a list of patients, and the appointment with a placeholder for each, but when I drag I can keep on adding to the placeholders.
I can create a CodePen if that will help illustrate.
Thanks
The text was updated successfully, but these errors were encountered: