1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    26
    Answers
    2
    Vote Rating
    1
    getbogged is on a distinguished road

      0  

    Default Answered: Find drag and drops original drag location

    Answered: Find drag and drops original drag location


    I have a grid panel that is dragging rows to another grid panel with

    Code:
    drop: function(node, data, dropRec, dropPosition, record) { console.log(node) ... etc }
    I need to get the originating panel id from the drag. I am sure it inside one of those but i have been looking and i can't seem to find this.

  2. See if this works for you. I realize it's just from GridA to GridA, but the drop event's params should work for a second destination grid, too, I believe.

    Code:
    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name'],
        data: [["Lisa"], ["Bart"], ["Homer"], ["Marge"]],
        proxy: {
            type: 'memory',
            reader: 'array'
        }
    });
    
    
    Ext.create('Ext.grid.Panel', {
        store: 'simpsonsStore',
        columns: [
            {header: 'Name',  dataIndex: 'name', flex: true}
        ],
        viewConfig: {
            plugins: {
                ptype: 'gridviewdragdrop',
                dragText: 'Drag and drop to reorganize'
            }
            , listeners: {
                drop: function(node, data, dropRec, dropPosition) {
                    console.log(data.view.ownerCt.id);
                }
            }
        },
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });

  3. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,470
    Answers
    442
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      1  

    Default


    See if this works for you. I realize it's just from GridA to GridA, but the drop event's params should work for a second destination grid, too, I believe.

    Code:
    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name'],
        data: [["Lisa"], ["Bart"], ["Homer"], ["Marge"]],
        proxy: {
            type: 'memory',
            reader: 'array'
        }
    });
    
    
    Ext.create('Ext.grid.Panel', {
        store: 'simpsonsStore',
        columns: [
            {header: 'Name',  dataIndex: 'name', flex: true}
        ],
        viewConfig: {
            plugins: {
                ptype: 'gridviewdragdrop',
                dragText: 'Drag and drop to reorganize'
            }
            , listeners: {
                drop: function(node, data, dropRec, dropPosition) {
                    console.log(data.view.ownerCt.id);
                }
            }
        },
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    26
    Answers
    2
    Vote Rating
    1
    getbogged is on a distinguished road

      0  

    Default


    yep, thats it. Thank you!

Thread Participants: 1

Tags for this Thread