Hi Maxim,

"revert" options can take a function as argument [1]. maybe you can use it
and test for an additional css class?
I did a quick test and it works as expected:

MyDraggable {

    @Override
    public void onConfigure(JQueryBehavior behavior)
    {
        super.onConfigure(behavior);

        behavior.setOption("revert", "function(e) { console.log('e', e); if
(e.hasClass('green')) { return true; } }"); // true means "do revert"
    }
}

In conjunction to Droppable#onDrop, where you can reject the Draggable
item/component if is not on the correct Droppable

Hope this helps,
Sebastien

[1] https://api.jqueryui.com/draggable/#option-revert

Reply via email to