Announcement

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

    Tree TreeGrid and hierarchical data problem

    SmartGWT Ver: 2.5
    SmartGwt App Engine Ver: 1.5.4
    GWT SDK: 2.4.0
    Eclipse Ver: Indigo
    Eclipse GWT Plugin 2.4.2

    This is a question about how to best use a TreeGrid and Tree where
    I have a Tree with a hierarchy of nodes: folders and leaves.

    When a node is moved from the unassigned TreeGrid to the assigned TreeGrid, I want to maintain the hierarchical relation of the node being dragged that is if a leave of a parent with many leaves is moved, I want to create a copy of the parental hierarchy of the leaf and put the entire structure into the hierarchy of the assigned TreeGrid.

    Example
    <code>
    unassigned grid
    Root
    ----12
    ------A
    ------B
    ------C
    ----13
    ------A
    ------B
    ------C

    assigned grid
    Root (is otherwise empty)

    The node 12.B is selected to be moved and the user clicks the right move button.

    after move of the struction 12.B
    Unassigned TreeGrid
    Root
    ----12
    ------A
    ------C
    ----13
    ------A
    ------B
    ------C

    Assigned Grid
    Root
    ----12
    ------B

    Here B has been removed from the Unassigned TreeGrid and moved to the Assigned TreeGrid and the parent 12 has been cloned, B added as a child to the cloned 12 and the cloned 12 and its child added to the Assigned TreeGrid.

    How would I be able to accomplish this? Ideas?

    #2
    If the problem is not clear from my first post please say so and I will state in another way...

    Comment


      #3
      C'mon IsoMorphic, please at least aknowledge my question. Again, if it is not clear then say so and I will try to make it more clear...

      We are considering to use your product, but if we cannot get any traction with things like this we may well move on to the next candidate product.

      Comment


        #4
        The reason you haven't gotten any community replies is probably because this is covered in a sample.

        Comment


          #5
          This issue is NOT coverd in the sample you cite.

          In your sample the hierarchical relationship is NOT maintained in the movement of a leaf from one Tree to another. In your sample, the leaf can be dropped anywhere in the receiving tree.

          If you read my question, I am asking how to enforce the hierarchical relationship in the move of a leaf from one tree to another.

          Please read my example...you are making a number of assumptions without reading.

          Comment


            #6
            Want this to get attention...bump

            Comment


              #7
              Your post is not really very clear about your requirements. However, take a look at the FolderDropEvent and DropMoveEvent for how you can control tree to tree drag and drop in a custom way.

              Comment


                #8
                thanks, I will look at the samples that you cite and get back to you on this...

                Comment


                  #9
                  IsoMorphic, Please read this carefully.

                  I desire to write code to do the following:
                  Assume Tree 1 is on the left hand side of the screen and Tree 2 is on the right hand side of the screen.

                  Before Move

                  Tree 1
                  ***********
                  12 (parent)
                  A (child)
                  B (child)
                  ***********

                  Tree 2
                  ***********
                  (no items in this tree)
                  ***********

                  Now: a user selects the child B from Tree 1 and clicks a move button which is supposed to move a selected item from Tree 1 to Tree 2 maintaining the child parent relationship.
                  These Trees are NOT to support Drag.

                  After Move of B from Tree 1 to Tree 2.
                  Tree 1
                  ***************
                  12 (parent)
                  A (child)
                  ***************

                  Tree 2
                  ***************
                  12 (parent)
                  B (child)
                  ***************


                  Question: how can this be accomplished programmatically when the move button is clicked. Remember this is not a drag and drop situation.

                  I cannot find any of your showcase examples that demonstrate this behavior.

                  Comment


                    #10
                    If it's not a drag, then use the Tree API to make the changes you want when the button is clicked. The Tree is the data model for a TreeGrid.

                    Comment


                      #11
                      Thanks, your referrals helped me to solve my problem and everything now works are I had to make it work.

                      Many Thanks....

                      Comment


                        #12
                        hey siegersallee,

                        Can you explaine how did you resolve your issu? i want to do same drag and drop but i couldnt...
                        thanks

                        Comment

                        Working...
                        X