Restrict drag based on the node image


I want to restrict drag n drop feature in tree by checking the dragged node images.

My requirement is, i should not allow dragging of branch node. Only leaf node will be dragged and dropped.

Help need for:

1- How to check the dragged node image name ?

2- Based on various images how could i restrict the drag n drop functionality ?

Kindly help ASAP.


there is hasChildren method that can be used know if item is a leaf or a folder.

For example:


return !tree.hasChildren(sourceId)


If you need to know item image, you can use the following method var url = tree.getItemImage(itemID)