JQuery - Drag, Drop and Sortable

15 views Asked by At

I have containers and container items, I want to implement the following features:

  • Items can be dragged and dropped between containers (1)
  • Items can be arranged inside the container (2)
  • An item can be dropped and merged into another item if the conditions are met. After merging, the card will be removed from the DOM. If it is not satisfied and cannot be merged, it will be reverted to its old position. (3)

The code below works fine for requirements 1 and 2, but for requirement 3, I don't have any solution for it at all

$(".connected-sortable")
            .sortable({
                connectWith: ".connected-sortable",
                stack: ".connected-sortable .day-content-item-enable",
                items: ".day-content-item-enable",
                stop: function (event, ui) {    },
            })
            .disableSelection();

Hope to receive a response soon, thank you very muchenter image description here

0

There are 0 answers