Results 1 to 4 of 4

Thread: Drag from tree to grid

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    10

    Default Drag from tree to grid

    I have a setup identical to the one in the post below where I'm trying to capture a tree node dropping on a grid whose container has been setup as a droptarget. This works perfectly and i'm able to trap the drop of a tree node, however if I try to drag and reorder grid columns the droptarget is also accepting the header fields and breaking the grid column reordering functionality. Anyone help would be greatly appreciated. Thank you in advance.

    http://extjs.com/forum/showthread.ph...tree+node+drop
    grid = new Ext.grid.Grid('eng-grid', {
    ds: ds,
    cm: cm,
    selModel: sm,
    loadMask: true,
    enableDragDrop:true,
    enableColLock:false
    });
    var drop = new Ext.dd.DropTarget(grid.container, {
    ddGroup : 'GridDD',
    notifyDrop : function(dd, e, data){
    debugger;

    for(var i=0; i < data.node.length; i++) {

    }
    alert('Someone dropped on me!');
    }
    });

  2. #2
    Ext User
    Join Date
    Mar 2007
    Posts
    10

    Default help

    Anyone have any ideas here? Am I posting in the wrong forum?

  3. #3
    Ext Premium Member BernardChhun's Avatar
    Join Date
    Mar 2007
    Location
    Quebec, Canada
    Posts
    831

    Default

    you can check the dragged object type in the beforeNodeDrop event if I recall. if it's something else than a grid's line then make sure e.cancel is equal to true:

    Code:
    Tree.on('beforenodedrop', function(e){
     // checkout what is in the e param
     /* ... */
     e.cancel = true;
    });

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    10

    Default re:

    thanks for replying. Unless I'm wrong, i think that would solve another issue.

    The problem i'm having is: When i drag column headers (to reorder columns) the drop zone is recognizing the columns as an accepted group. So when i drag a column over the grid (any arear, it breaks the existing built in grid column drag and drop functionality.

    Any other help would be greatly appreciated.

Posting Permissions

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