This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes GWT and the fly likes SmartGWT TreeGrid Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "SmartGWT TreeGrid" Watch "SmartGWT TreeGrid" New topic

SmartGWT TreeGrid

Vincent Oh
Ranch Hand

Joined: Jan 02, 2012
Posts: 33
I need to limit the max depth a user can drag and drop a node.

For eg. Taking root level as level 1, i want to limit user to only drop till the 3rd level, in other words, only a tree of 3 levels is allowed.

I tried to change the node values onDropEvent, but it will create a duplicate with the changed valued and end up causing alot of errors due to duplicate keys.

Kindly advise, thanks!
Ankit Garg

Joined: Aug 03, 2008
Posts: 9453

You can use the addFolderDropHandler method to add a handler to handle record drops. After that you can use FolderDropEvent.getFolder() to get the target folder for the drag-and-drop operation to check your precondition and cancel the event if your condition is not met...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: SmartGWT TreeGrid
It's not a secret anymore!