Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

SmartGWT TreeGrid

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic