I’m having a set of droppables, each associated with (accepting) one specific draggable. So draggable A can only be dropped on droppable A. What I want is for the droppables that wont accept the draggable to still get its hoverClass when I drag the draggable onto it.
The desired behavior is for the user not to know whether or not a draggable will be accepted until it is dropped, without losing the hoverClass entirely.
First of all: is there a configuration for this already, that I’ve missed?
If not: how would you go about solving the above? Would it be easier to manually add and remove hoverClass as needed, or to have the droppables accept all draggables, and manually revert on an invalid drop?
Use the activeClass-option for the droppable. This allows you to highlight the droppables that accept the currently dragged draggables. But of course this is not what you want to do.
To get the desired behaviour, you really have to accept all draggables on all sortables.
There may be different solutions, one might be:
on over of the droppable determine, if the draggable is accepted(I mean accepted by you, not by the droppable, as there are all draggables accepted).
Assuming, you set revert to true in all draggables, you can now set the revert-option of the draggable to false(if its accepted). Otherwise add the class for highlightning if unaccepted draggables are received.
On stop of the draggable remove the class set above and set revert back to true.
See an example: http://jsfiddle.net/doktormolle/rJkpu/