Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

add dropOnEmpty:true to the options parameters.

Make sure your target list is styled float:left

I had a similar experience today.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top