yogi
yogi

Reputation: 11

In Ext JS, how to get the id or other info of the node which is dragged and dropped in tree structure?

I have created a dragable tree structure using Ext JS. I want the id of the node being dragged in 'drop' function of tree panel listener so that I can pass it to one php file for processing. Thanks.

Upvotes: 0

Views: 71

Answers (1)

pherris
pherris

Reputation: 17733

When you are listening to the drop event, you are passed the DOM node and data from the dropped item:

http://docs-origin.sencha.com/extjs/4.2.2/#!/api/Ext.tree.plugin.TreeViewDragDrop-event-drop

e.g.

    this.mon(this, 'drop', this._onDrop, this);

    _onDrop: function(rowEl, dropData, overModel, dropPosition, opts) {
        var droppedRecord = dropData.records[0];
    },

then the droppedRecord should have the ID you need.

Upvotes: 1

Related Questions