Closed JanVeb closed 1 year ago
@JanVeb you can do this by setting a filtered class ass shown in the docs https://sortablejs.github.io/Sortable/#filtered
Thank for replay,
With filtered class you can stop item from moving, but can move other elements in above or under filtered class, which for button isn't viable as it should always be on same place without possibility to push other elements under it.
Though I sorted this in another way, if I remember correctly I wrapped sortable in container and added button to container instead
https://stackoverflow.com/questions/35316656/sortablejs-disable-sort-on-a-specific-element
Need to be able to lock certain items in a sortable group, like button to add new items to that group
Found a way to do it in this StackOverflow answer, though issue is that when all the items from one group are pulled to another group, then cant anymore pull new items to empty group.
As you can see in the picture, i was able to pull all the items from Companies group to Fruits group, white labels Companies and Fruits stayed on their place, but no i cant anymore place any more items from Fruits group to Companies group.
Is there another way to lock specific elements from being sortable, or how to edit this code so that it works as expected, that is, even when group is being emptied out, elements should still be able to be added to it