0 Replies Latest reply on Dec 27, 2007 2:50 AM by lucky_raga

    drop action occuring twice in a tree


      I have two trees from which i drag and drop across items. the tree has only one-level hierarchy.
      When i drag an item onto another tree, i create a branch same as that of the dragged item's parent
      and add this dragged item to the newly created parent.
      I can see this new parent with the dragged item but the problem is one more copy of the dragged item
      appears at the branch level.
      I tried using event.preventDefault() but for no use.

      The code looks like:

      var insertNewParentNode:XML = <b></b>;
      var childNode:XML = <c></c>;
      childNode.@label = draggedItemStore.@label;
      insertNewParentNode.@label = draggedItemParentStore.@label;
      trace("newnode: " + insertNewParentNode);
      var treeNodeColl:ICollectionView = dropTarget.dataProvider as ICollectionView;
      var treeCursor:IViewCursor = treeNodeColl.createCursor();
      var treeNode2:XML = treeCursor.current as XML;
      dropTarget.dataProvider = treeNode2;