View Full Version : TreePanel DnD Dynamic Targets

21 Feb 2009, 10:44 PM
I have been searching high and low, and have not found what I am looking for. I may be searching for the wrong thing, so I appeal to the more versed ExtJS Devs for assistance!

I need to have a tree panel that has nodes of varying "types". These types define what other node types can be children of said type. Vague? - Sorry.

Ex. I may have a tree of folders. Folder of type "Folder-A" will only allow files of type "File-A", however, Folder of type "Folder-B" will allow files of type "File-B", but also allow folder of type "Folder-A" and "Folder-B".

This not really confusing, but, simply, nodes will represent different data items, and they can only be placed in constrained locations.

I believe I have figured out how to have the context menu change based on node attributes, but, do not seem to see or find an example of being able to define the allowed drop targets based upon an attribute or custom function. Simply, the Dragged node needs to verify its ability to be position under the drop destination.

Beyond the basics, I would also like to experiment with the allow drop target types being pulled via ajax on a "begin drag" type action, but would suffice with attribute based approach.

Any suggestion? Can a function be called on allowDrop? Pointers, Tips, Etc?

Thanks in advance for your support


23 Feb 2009, 9:47 PM