Lock to avoid dragging in sortable

Asked

Viewed 144 times

2

This week I received the help of Lucio Rubens with a doubt, he helped me with this code, to get the Ids of the elements clicked.

Now on top of this same code, I need to lock a UL so that it does not allow more elements to be removed,

This is the working example, Jsfiddle.

$(".items").sortable({
    connectWith: ".items",
    receive: function(event, ui) {
        var id_origem = ui.sender.attr("id"),
            id_clicado = ui.item.attr("id"),
            id_destino = $(this).attr("id");
    }
});
  • Can you explain better what and when you want to do that block? It’s unclear to me.

  • Marcus, Michel solved for me, thank you!!!

1 answer

3


In the example in the link below, I inserted a block class not to allow the withdrawal of it, in this way, it receives the items but does not leave it.

http://jsfiddle.net/sw4gs7nh/

  • 1

    And this memo Michel, now I will try to work with her to warn if the people try to get something out there, thanks for the help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.