View Full Version : dragging a treepanel node onto a regular panel

7 Nov 2012, 1:42 PM
How does one handle a drop event from a treepanel to a normal panel? I've seen many examples using treepanels to gridpanels, but nothing related to normal panels, which don't seem to have a special plugin.

What I'd like to do is drag a leaf node from my treepanel onto another panel and have it fire some event with meaningful data (where it was dropped, the node info, etc.)

I currently have code for the treepanel that looks like it would be draggable, but I can't find any examples of handling the actual drop.

viewConfig: {
allowCopy: true,
copy: true,
ptype: 'treeviewdragdrop',
dragGroup: 'dragGroup',
dragText: 'Drag into panel',

I figured the code would look something like this, but I can't find any docs for handling the event or even if Panel needs a special plugin like treepanel and gridpanel do. I just want access to a function that fires when something is dropped onto the panel with the item info.

var panel = Ext.create('Ext.panel.Panel', {
title: 'foo',
width: 200,
html: '<p>World!</p>',
viewConfig: {
dropGroup: 'dragGroup'

Is there some existing function on the panel xtype I can just include or is it much more complicated then that? Thanks.

7 Nov 2012, 10:32 PM

you can see this link :http://examples.extjs.eu/