[Project_owners] Drag and drop to reorder a custom tree view

Neil neil at parkwaycc.co.uk
Tue Jan 30 09:43:03 PST 2007


David Murray wrote:

> I've got a one column custom tree view

You need to implement the drag and the drop separately.

For dragging you need to handle the ondraggesture event. Although you 
can extract the mouse coordinates from the event to work out which cell 
was dragged, the design of the tree means that the items you want to 
drag are probably already selected.

For dropping simply implement the canDrop and drop methods of your tree 
view; the tree body frame automatically passes you the correct row.

You can't avoid the ton of xpcom stuff needed to interact with the drag 
service.

messengerdnd.js is an example of how to do dnd but note that the folder 
pane uses RDF rather than a custom tree view so the call is slightly 
different.


More information about the Project_owners mailing list