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

Malte Kraus firefox at maltekraus.de
Tue Jan 30 09:15:09 PST 2007

David Murray wrote:
> Yep, what the subject says. I've got a one column custom tree view built 
> from an array, and I want to be able to drag the rows up and down to 
> reorder the tree/contents of the array.
Yeah, I'm going through this hell right now as well. :-( (Though with a 
hierarchical tree which makes things even more complicated...)

I think, you have to include this script in your XUL file:
<script type="application/x-javascript"
and edit the treechildren node like this:
<treechildren id="engineChildren" flex="1"

Then, you'll have to define the gDragObserver object referenced above in 
your JavaScript file and modify your tree view to support drag & drop. 
Have a look at how Mozilla did it:


More information about the Project_owners mailing list