PDA

View Full Version : Tree controls, detecting line type


charlesshoults
08-05-2009, 04:18 AM
I'm using a tree component in my website, using it as a friends list. To the right of the list, I have a series of buttons, create group, remove group, remove friend and change icon. The data for the controller is derived from XML.

When you click on the tree controller, is there a way to detect the type of item that is selected?

Another thing I discovered when working with drag and drop capabilities, is this: If I have a folder with three leaf nodes below it, the folder displays either the open or closed folder, as appropriate but if I drag the three nodes out of the folder, the folder node then loses the icon and it won't let me drag the items back into the folder.

charlesshoults
08-06-2009, 05:24 PM
I found it more useful to go another direction. The tree controller still uses XML for it's source. When I read the data from the mysql database, I populate an array collection then use the array collection to build the XML. As data changes, it rebuilds the XML and when changes are to be submitted, I format the contents of the array collection and send it back to the database for storage.