@Pulse Mark them isFolder:true, but also provide an empty children array.
SetChildren
Thank you very much for the quick reply, I was looking in the Tree and not in the node itself to set the children, so I just couldn’t find the setChildren property to test what you were talking about. And yeah, now I just setChildren(new TreeNode[0]) and it works perferctly! (yeah I’m in SmartGWT).
So again, thank you very much for all the work and quick support, you guys rock!
(btw, are you just the 2 of you with sanjiv, and sometimes another dev pointing he’s nose? because it looks like you are everywhere!)
So as a quick recap:
- setCanDropOnLeave(true) won’t transform leaves into folders
- use only folders and not leaves (setIsFolder(true))
- when you want a node to act like a leaf (no ‘+’ sign): node.setChildren(new TreeNode[0])
- use addFolderDropHandler and other drophandlers if needed to set empty node of children when needed
Or whatever are the equivalent in JS for the SmartClient.