1. #1
    Ext User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    srohweder is on a distinguished road

      0  

    Question Multiple DragZones

    Multiple DragZones


    Hey,

    ive tried yesterday to solve a problem with 2 DataViews and DropZones, now i`ve broken down the Problem to a simple example.

    Only 2 divs and the wish to drag and drop between those 2 divs. The Problem is the dropping on both areas.

    It only works on one div, in this case from homezone to unlinkzone but not the other way. If i switch the initialisation of the 2 DragZones the behavior is the other way around.

    Is it only possible to have one DragZone in the script ?
    do I miss something important i didnt saw in the Docs ?

    HTML Code:
    <div id="unlinkzone" style="width:50%;height:50%;">
    <div class="thumb"><img width="90" src="home_photo_1.jpg"></div>
    <div class="thumb"><img width="90" src="home_photo_2.jpg"></div>
    <h2>Unlinkzone</h2>
    </div>
    
    <div id="homezone" style="width:50%;height:50%;">
    <div class="thumb"><img width="90" src="home_photo_3.jpg"></div>
    <div class="thumb"><img width="90" src="home_photo_4.jpg"></div>
    <h2>Homezone</h2>
    </div>
    Code:
    Ext.onReady(function(){
    
        Ext.QuickTips.init();
    
            
        var dragzone2 = new Ext.dd.DragZone(Ext.get('homezone'),{
            ddGroup: 'home',
            getDragData: function(e){
                var sourceEl = e.getTarget('.thumb');
                if(sourceEl){
                    d = sourceEl.cloneNode(true);
                    d.id = Ext.id();
                    return {
                      ddel: d,
                      repairXY: Ext.fly(sourceEl).getXY()
                    }
                }
            },
            getRepairXY: function(){
              return this.dragData.repairXY;
            }
        });
                
        var dropzone2 = new Ext.dd.DropTarget(Ext.get('homezone'),{
            ddGroup: 'unlinked',
            notifyDrop: function(source, id){
              alert('drop on homezone');
            }
        });
        
        var dragzone = new Ext.dd.DragZone(Ext.get('unlinkzone'),{
            ddGroup: 'unlinked',
            getDragData: function(e){
                var sourceEl = e.getTarget('.thumb');
                if(sourceEl){
                    d = sourceEl.cloneNode(true);
                    d.id = Ext.id();
                    return {
                      ddel: d,
                      repairXY: Ext.fly(sourceEl).getXY()
                    }
                }
            },
            getRepairXY: function(){
               return this.dragData.repairXY;          
            }
        });
    
        
        var dropzone = new Ext.dd.DropTarget(Ext.get('unlinkzone'),{
            ddGroup:'home',
            notifyDrop: function(source, id){
              alert('drop on unlinkzone');
            }
        });
        
    
       
    });

  2. #2
    Ext User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    srohweder is on a distinguished road

      0  

    Default


    Updated and simplified code

  3. #3
    Ext User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    srohweder is on a distinguished road

      0  

    Default


    Hey do I missed something in the description of the Code or is this something extremly obvious so noone answers ? Or is it too easy and I should know ?

    srohweder

  4. #4
    Ext User
    Join Date
    Dec 2009
    Posts
    6
    Vote Rating
    0
    srohweder is on a distinguished road

      0  

    Default


    polite bump,
    no one has answers on this ? even if its only the info that the example does not run ?

    I figured out that the Code works when the ddGroups left out, but in this case you can drop everywhere in the dropzones, thats not the goal.

    I made an image of the behavior I will achieve
    dnd_dragzones.png

Similar Threads

  1. Question about Dropzones
    By crink in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 13 Aug 2010, 9:17 AM
  2. Problems with two dataviews
    By manuito in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 11 Feb 2010, 6:23 AM
  3. Can draggable panels work with dropZones?
    By zombeerose in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 16 Oct 2009, 4:28 AM
  4. [2.2.x] Dragging onto Obscured DropZones
    By hast in forum Ext 2.x: Bugs
    Replies: 3
    Last Post: 11 Feb 2009, 2:44 AM

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar