Results 1 to 3 of 3

Thread: DragDrop problem [SOLVED]

  1. #1
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    327

    Thumbs up DragDrop problem [SOLVED]

    Hi everyone,

    I've a problem at drag & drop between two grids. I followed the sample on the examples page, but it doesn't work.
    I'll be happy if someone helps me. By the way I don't take any errors on Firebug..

    Thanx in advance..
    With regards..

    Code:
    var secondGrid = new SmallPersonellerGrid({ title : 'Second Panel', height : 300,enableDragDrop:true,ddGroup : 'thirdGridDDGroup' });
    var thirdGrid = new PersonelVekalet({ colspan : 2, ddGroup : 'secondGridDDGroup',enableDragDrop:true });
    
    var blankRecord = new recordPersonelVekalet();
    var thirdGridDropTarget;
    var secondGridDropTarget;
    
    var mainPanel = new Ext.Panel({
    	title	: 'Main Panel',
    	iconCls : 'panel',
    	layout	: 'table',
    	layoutConfig: {
    		columns	: 2
    	},
    	items	: [ gridPersoneller, secondGrid, thirdGrid ],
            ......, listeners : {
    	afterrender : function(comp) { // cuz of preventing scroller undefined error
    		var thirdGridDropTargetEl = thirdGrid.getView().scroller.dom;
    		thirdGridDropTarget = new Ext.dd.DropTarget(thirdGridDropTargetEl, {
    		    ddGroup    : 'thirdGridDDGroup',
    		    notifyEnter : function(ddSource, e, data) {
    				//Add some flare to invite drop.
    				thirdGrid.body.stopFx();
    				thirdGrid.body.highlight();
    			},
    		    notifyDrop : function(ddSource, e, data){
    		        var records =  ddSource.dragData.selections;
    		        Ext.each(records, ddSource.grid.store.remove, ddSource.grid.store);
    		        thirdGrid.store.add(records);
    		        return true;
    		    }
    		});
    		
    		var secondGridDropTargetEl = secondGrid.getView().scroller.dom;
    		secondGridDropTarget = new Ext.dd.DropTarget(secondGridDropTargetEl, {
    		    ddGroup    : 'secondGridDDGroup',
    		    notifyEnter : function(ddSource, e, data) {
    				//Add some flare to invite drop.
    				secondGrid.body.stopFx();
    				secondGrid.body.highlight();
    			},
    		    notifyDrop : function(ddSource, e, data){
    		        var records =  ddSource.dragData.selections;
    		        Ext.each(records, ddSource.grid.store.remove, ddSource.grid.store);
    		        secondGrid.store.add(records);			
    		        return true;
    		    }
    		});	
    	}
            }
    });
    Last edited by talha06; 4 Jan 2011 at 12:27 AM. Reason: solved
    "People will never forget how you made them feel."
    linkedin.com/in/talhakabakus

  2. #2
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    327

    Default

    I solved it myself, someone who has this problem can benefit from here : I tried to add drag drop setup after main panel was rendered. The right way is adding these setups after each grid is rendered. So I added listeners to each grid; not to main panel.
    "People will never forget how you made them feel."
    linkedin.com/in/talhakabakus

  3. #3

    Default

    Thanks for posting this!!


Similar Threads

  1. Ext.Button and Ext.dd.DD : problem with DragDrop
    By BlueSkye in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 10 Jun 2010, 12:08 PM
  2. DragDrop and Sort
    By luca.santaniello in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 10 Dec 2009, 6:36 AM
  3. Reordering Panels Using DragDrop Problem
    By cooper236 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Aug 2008, 1:48 PM
  4. DragDrop Help
    By INeedADip in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 18 Sep 2007, 6:35 PM
  5. problem trying DragDrop example in nested layout
    By harish in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 14 Jan 2007, 6:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •