1 Reply Latest reply on Jun 18, 2011 4:33 PM by Shongrunden

    Drag and Drop between two Trees

    Zolotoj Level 3

      How exactly do we drag and drop between trees keeping source nodes in place without removing, another words how do we copy nodes between trees?

       

      Thanks

        • 1. Re: Drag and Drop between two Trees
          Shongrunden Adobe Employee

          I haven't tried this with Trees, but dragEnabled/dropEnabled works in this example for List:

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                         xmlns:s="library://ns.adobe.com/flex/spark">

           

              <s:layout>

                  <s:HorizontalLayout />

              </s:layout>

           

              <s:List id="list1" dragEnabled="true">

                  <s:dataProvider>

                      <s:ArrayList>

                          <fx:String>0</fx:String>

                          <fx:String>1</fx:String>

                          <fx:String>2</fx:String>

                      </s:ArrayList>

                  </s:dataProvider>

              </s:List>  

           

              <s:List id="list2" dropEnabled="true">

                  <s:dataProvider>

                      <s:ArrayList>

                          <fx:String>A</fx:String>

                          <fx:String>B</fx:String>

                          <fx:String>C</fx:String>

                      </s:ArrayList>

                  </s:dataProvider>

              </s:List>

           

          </s:Application>

           

          Maybe make sure that you have dragMoveEnabled="false" ?