Following the link to the jQuery UI Droppable example: Cart. I rewrite it for a test. But there are some problems.
Let's pretend that:
product container: drag the product into the container of the shopping basket.
<div class="products">
<ul>
<li> product 1 </li>
...
</ul>
</div>
and a basket basket for shopping:
<div class="shoppingCart1">
... dropped products here
</div>
and other containers for purchases :
<div class="shoppingCar2">
... dropped products here
</div>
And I want shoppingCart1 products to be dragged into another container of the shopping basket , but not by myself, and vice versa. E..g:
problem:
s * hoppingCart1 *, shoppingCart1 . , , . , shoppingCart1 shoppingCart1, shoppingCart1.
!
JQuery UI Droppable: ! [ , ]
this.igtoMDMovieList = $('<div />',{'class':'igtoMDMovieList'})
.appendTo(this.igtoMDMovieListWrapper);
this.igtoMDMovieListOL = $('<ol />',{'class':'igtoMDMovieListOL'})
.html('<li class="placeholder">Add your items here</li>')
.appendTo(this.igtoMDMovieList)
.droppable({
accept:'li',
drop: function( event, ui ) {
$( "<li></li>" )
.text( ui.draggable.text() )
.appendTo(obj.igtoMDMovieListOL)
.draggable({
appendTo: "#desktopFrame",
helper: "clone"
})
}
})
.sortable({
items: "li:not(.placeholder)",
sort: function() {
$( this ).removeClass( "ui-state-default" );
}
});