-
28 Nov 2010 6:52 AM #1
Drag & drop elements beetween panels
Drag & drop elements beetween panels
Hi! I created my GUI with the Designer; there is a tree panel on the left and a panel on the right; I need to drag elements from the tree panel and drop them to the panel on the right. Jarred said to me that I have to set enableDrag: true on my TreePanel, and then program a DropZone for your Panel. How can I program a DropZone?? Thanks for the help
-
28 Nov 2010 11:47 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
-
29 Nov 2010 1:02 AM #3
Thank you very much! I'm using the designer, so, where must I write the code for the drag and drop?? in the .js file? and then, when I drag an element I don't wanna cut it, but I wanna that this element is copied in the panel.. is it possible to do this?
-
2 Dec 2010 1:09 AM #4
Anyone can help me?? I need it for my thesis

-
6 Dec 2010 2:20 AM #5
I found some code and I tried to implement it, but it doesn't work

This is my Viewport.js (I implemented the interface with the Designer... datFed is the autoRef of my panel)
When I execute the page, it renders as a white page. With Firebug, I see that in this piece of code:PHP Code:Viewport = Ext.extend(ViewportUi, {
initComponent: function() {
Viewport.superclass.initComponent.call(this);
var detailsPanel = Ext.getCmp('datFed');
var pnlDropTargetEl = detailsPanel.body;
var pnlDropTarget = new Ext.dd.DropTarget(pnlDropTargetEl, {
ddGroup: 'treeDDGroup',
copy: false,
notifyDrop: function(ddSource, e, data) {
var el = detailsPanel.body;
tpl.overwrite(el, data.node.attributes);
return true;
}
})
}});
this.el is nullPHP Code:Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group,
{isTarget: true});
-
20 Dec 2010 7:24 AM #6
My problem is that my detailsPanel hasn't the body, so detailsPanel.body is null
-
20 Dec 2010 7:46 AM #7
So override onRender!
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
20 Dec 2010 7:53 AM #8
so, does my code should look like this?
PHP Code:Viewport = Ext.extend(ViewportUi, {
initComponent: function() {
Viewport.superclass.initComponent.call(this);
var aaa = Ext.get('ciao');//this is the DIV on my page where I wanna put the drop target
var pnlDropTargetEl = aaa.onRender();
var pnlDropTarget = new Ext.dd.DropTarget(pnlDropTargetEl, {
ddGroup: 'treeDD',
copy: false,
notifyDrop: function(ddSource, e, data) {
alert("ciao");
return true;
}
})
}
});
Similar Threads
-
Tree Drag&Drop - copy&paste node, not cut
By SchattenMann in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 28 Oct 2012, 11:01 PM -
Drag & drop elements beetween panel
By DJ JJ in forum Ext Designer: Help & DiscussionReplies: 11Last Post: 27 Dec 2010, 6:09 AM -
Drag&Drop multiple elements
By Alex84 in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 29 Oct 2009, 8:12 AM -
[solved] xtype: portal - not working drag&drop panels
By RobertT in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 23 Sep 2009, 4:39 AM -
Unable to drag & drop into EditorTreeGrid after removing elements
By shroom in forum Ext GWT: DiscussionReplies: 3Last Post: 16 Sep 2009, 5:45 AM


Reply With Quote