[Project_owners] Drag and drop to reorder a custom tree view
David Murray
lid2000 at aanet.com.au
Wed Jan 31 17:56:01 PST 2007
Thanks a heap! I went poking through that and the Adblock Plus filters
screen to see how they did it, then wrote a much simpler version for mine.
Neil wrote:
> 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