Nested droppables and even propagation
Hi all,
I've got a canvas on which 2 types of div's can be dropped: projects and users. So basically what I'm trying ot achieve is linking users to projects, each user can participate in multiple projects and a project consists of multiple users.
So far so good if I drop a project it shows the project div with the projectmembers within. If I drop a user div it shows all the project divs in which the user is participating.
So the canvas is droppable for users and projects and a project is droppable for users hence the nested droppable. The only condition when a user is not allowed to be added to a project (using dnd) is that he or she is allready is added to the project. I've written a accept function that evaluates this.
It is here that the problem starts, if the accept function for a project evaluates to false the even is propagated to the parent droppable --> the canvas. The canvas shows the projects the rejected user participates in but this is not the behaviour I'm looking for, I want the dragged user to be reverted if the project accept function evaluates to false and for that I apparently need to stop event propagation. The problem is that in the project accept function the only argument is an array of nodes that are dropped so I can't acces the event.
So as far as I know in the accept function I don't have any reference to the event object and therefore I can't stop propagation which results in unwanted behaviour.
I hope you guys can shed some light on this.
Thanks
Best regards,
Remco