I've been using sencha GXT for a few days, and I'm currently trying to get Drag'n'drop between two trees representing different file-systems to work. This means that a duplicate file may be copied onto one system in several different folders - but since that file has the same key, the treestore breaks.
What I've tried so far, and results:
- Attempt: Do things in the TreeDropHandler/TreeMoveHandler
Result: Turns out these are for when the widget is getting moved
Attempt: Override TreeDataStore and override the add methods
Result: The add methods aren't even called when dragging and dropping into the tree - it seems they're only there for manually adding things to the treestore
Attempt: Just copying the entire treestore and modifying it to work how I want
Result: Tree specfically expects the treestore class, and not something that implements some abstract class, unfortunately, so I can't do this
Attempt: Override the insert methods in TreeStore
Result: These methods are inside a private subclass within the treestore, so I can't directly access them
Attempt: Making the modified version of the treestore class extend the original and just hide everything
- Result: The compiler will tell my I need an @Override infront of a variable to deal with duplicate types, and when I add it, it will tell me there is nothing for it to override (x 100)
I'm a tad stuck on what else I can even try to do at this point. If anybody has any advice or examples, I would be most grateful.
I eventually hacked together something that works (for my specific usage case) when dragging and dropping things between two trees - the specific key instance isn't important, mine just keeps the path to the item itself as part of the key - the main part was just modifying appendModel to individually add tree components using inserts instead of addSubTree, so I had a data type I was actually allowed to make instances of.
If anyone can find a better way though, I would love to see it.