Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Drag Drop from listgrid to treegrid

    I need a simple code sample. Please kindly help. I've tried many way and can not work.

    The requirement is as below:

    1. A ListGrid in left side, containing customer list
    2. A TreeGrid in right side, Containing Organization Tree
    3. Drag from Customer listgrid from left side and drop to Organization Tree on the right side.
    4. Save button to save the matching result.

    The main issue is , I can not get the target record on the right side, with the infomation of its parent id. So I don't know how to save the drag && drop result. Please provide the code sample, how to get the traget record in a drag drop event.

    #2
    set canAcceptDroppedRecords to true on the TreeGrid and canDragRecordsOut to true on the ListGrid.
    Then if desired, apply a folderDropHandler to the treeGrid and write custom logic to handle the drop. The folderDropEvent will contain details of the target folder the user dropped into. Calling event.cancel() will suppress the default behavior of moving the drag data into the tree.

    Comment


      #3
      I have a similiar requirement, but I need to drag from a listgrid to a leaf node. I don't want to add/remove something to the tree but I simple need the information which record of the tree was dragged and on which leaf it was dropped.
      I also activated canDropOnLeaves but with folderDropEvent I only got the node information and not on which leaf it was dropped.
      How I can get this information?

      Comment


        #4
        getEventRow() will tell you the coordinate of the drop, from which you can figure out which TreeNode / Record was hit.

        Comment


          #5
          I'm writing some DnD code between two tile grid.

          Funny thing is, when I drag one element from source grid to the target grid, all elements in the source are gone. But only the one I dragged appear in target grid.

          But when I drag the new one in the target grid back to the source, all elements appear in the source again.

          Do you have an explanation why that is happening?
          Last edited by fei.yan; 14 Dec 2011, 12:59. Reason: rephrase

          Comment

          Working...
          X