PDA

View Full Version : Changing the style class of the droptarget or dropzone



bidyut
14 Jun 2007, 11:16 AM
Here is my use case:

I am trying to drop a node into a drop zone. If the drop is not allowed, I can successfully set


dropEvent.cancel = true;

At the same time, would I be able to change to css class so that instead of showing the "green plus" image to the "red no" sign. I know that is set by the dropNotAllowed config property. But is there way I can set the config property after setting the dropEvent.cancel to true?

Thanks

para
15 Jun 2007, 6:21 AM
Where are you setting this dropEvent.cancel? I'm assuming that you're setting it in a function called like

tree.on('beforenodedrop', yourFunction);

Here's a way that takes care of it all for you.


tree.on('nodedragover', treeNodeDragOver);

function treeNodeDragOver(e){
// return true/false based on whatever rules you want to establish.
// (false disallows the drop)
}



Let me know if this works for you.

bidyut
15 Jun 2007, 2:24 PM
Thanks. It worked as I expected.