I'm trying to create a tight integration between two trees and a 'desktop'
on which are floating elements (cards).  I need to be able to:

* drag and drop a tree node to the 'desktop' to 'open' the card that the
node represents
* drop a tree node onto an open card in order to create a relationship
between them
* drop an open card onto a tree node (also creates a relationship)
* drop either an open card or a tree node anywhere on the 'tree' object that
is not otherwise a drop target in order to effectively drop the card on the
'root' node of the tree

(because 1.0 is not out yet, I'm using 0.9.9a of jsTree)

I added droppable to my desktop element, but no event fires when I drop a
tree node onto it.  What is the correct way of telling when a tree node is
dropped on something outside the tree?  Does the helper need to have the
ui-draggable class in order to work with a droppable, or is there more to
it?

I also added a call to the tree's drop_mode inside the draggable's .start()
event.  I can't see any evidence that it did anything, other than I know the
call was made:  $.tree.drop_mode({type:X}).  Now, when I drag around a card,
it drags the original element, so it is possible that the mouse events are
being received by the card element, and never making it to the tree.  But
the drag-and-drop behavior of the card is exactly what I want, the card is
semi-transparent so I can see what I am dropping it on.  Items set as drop
points using 'droppable' work fine, but the tree does not.  What is the
correct way of working with the tree and 'draggable' objects?

Also, draggable objects support a 'revert' animation.  I'd like to be able
to revert the dropped card if I am holding the meta key, and close the open
card if I am not.  That is a question for the jQuery UI team, I suppose, but
I'm asking it here, too, in case you happen to know the answer.

Another thing I want is to have the default behavior differ depending on
whether or not I am dragging-and-dropping within a tree, or between trees.
Within a tree, I want the default action to be a 'move'.  Between trees, I
want it to be a 'copy'.  Looking at the source, it looks like it won't work
that way.  Am I understanding what I am reading correctly?  Is there a way
to simulate it?  Or do I need to add a feature to the tree code in order to
get that behavior?

-- 
John Arrowwood
John (at) Irie (dash) Inc (dot) com
John (at) Arrowwood Photography (dot) com
John (at) Hanlons Razor (dot) com
--
http://www.irie-inc.com/
http://arrowwood.blogspot.com/

Reply via email to