views:

574

answers:

3

I have three unordered lists that have been created as Scriptaculous Sortables so that the user can drag items within the lists and also between them:

var lists = ["pageitems","rowitems","columnitems"];    
Sortable.create("pageitems", { dropOnEmpty: true, containment: lists, constraint: false });
    Sortable.create("rowitems", { dropOnEmpty: true, containment: lists, constraint: false });
    Sortable.create("columnitems", { dropOnEmpty: true, containment: lists, constraint: false });

How can I make it so that if the user drags all the items out of a list, they're able to put them back again? At the moment it won't allow items to be dragged onto an empty list.

+2  A: 

Maybe the empty list has no height, and therefore no droppable area available. If that's the case, perhaps you just need to set a minimum height, or some padding on the block.

mercutio
A: 

Make sure your target list is styled float:left

I had a similar experience today.

Ross Morrissey
+1  A: 

add dropOnEmpty:true to the options parameters.

Colby