Draggable and sortable [Solved]

Draggable and sortable [Solved]

Hi all,

I'm new in this forum and also in jQuery.

I'm trying to implement a "trash" bin but i'm with a problem with sortable and draggable.

The elements to delete in trash need to be sortable in the original block, but if I make them draggable I can't sort them.

Here's an example code:

The HTML
<ul id="itens" style="background-color:#eee;">
<li class='item' id=0>Item 0</li>
<li class='item' id=1>Item 1</li>
<li class='item' id=2>Item 2</li>
<li class='item' id=3>Item 3</li>
<li class='item' id=4>Item 4</li>
</ul>

<div id="trash" style=" background-color:gray; height:200px;">


The JS
$('#itens').sortable();
$('.item').draggable();
   
$('#trash').droppable({
   accept: ".item",
   drop: function(ev, ui) {
      $('#trash').append("dropped");
   }
});


What I am doing wrong? Is it possible to implement what I want?

Thanks in advice