View Full Version : DD doubts
moraes
05-11-2007, 07:19 AM
Hi,
1. Maybe I'm doing something wrong, but I've noticed that if you drop something in the very border limit of a DropTarget or DropZone, the drop event considers the outside of the element as the target (althought it may not be set a DropTarget / DropZone) and proceeds normally. This sometimes has a bad effect, with things being dropped in a place where they are not allowed. I had to add checkings to onNodeDrop / notifyDrop to avoid this. Anyone else noticed this or have an idea about what is causing this?
2. How to set a whole div, including its child nodes, dragable as an unique element?
thanks!
moraes
05-11-2007, 12:12 PM
I posted an example here:
http://www.tipos.com.br/dev/extjs/dd_1.php
Clarifying:
1. Although the page body is not a drop target, if you drop an element on the edge of any drop targets, the dragable element is dropped in the body. Is it an ex
jgarcia@tdg-i.com
05-11-2007, 12:33 PM
Thanks for posting the link. I'm trying to understand EXT's D&D module, this should help a bit.
moraes
05-11-2007, 12:44 PM
I hope it helps! I'm trying to understand it too! :)
moraes
05-11-2007, 12:49 PM
Hmmm. I'm affraid I'm flooding a thread created by myself, but I have one more doubt.
3. Which trick do you use to keep a drop area not empty, so it will be always available? If a div is empty, it will disappear on FF, and then you lose your drop area...
A fixed height is a bad idea (put all the dargables in the same box in the example above, and one of them will be not available because it is out of the height).
Setting a min-height could solve the issue on FF, but I guess it would not work on IE...
So, how to ensure that the div will be 'expanded' and 'available' even if it is empty?
jsakalos
05-11-2007, 12:56 PM
Cannot you use handles, e.g. a parent container?
moraes
05-11-2007, 12:59 PM
Cannot you use handles, e.g. a parent container?
Ah, that's what I'm doing, a handle in the top of a parent container. I was just checking if it was the right thing to do or there was a trick to make the whole thing dragable. It seems that a handle is the right solution, then. Thanks.
jsakalos
05-11-2007, 01:00 PM
I cannot tell if it right but I can tell it works like charm for me;)
moraes
05-11-2007, 02:19 PM
Some more DD doubts...
4. How to change the text that appears in the 'ghost' layer when you are dragging an element.
5. How to create a smooth temporary div to show the place where the element will be dropped. I've created it here but as you see it is very rudimentar...
http://www.tipos.com.br/dev/extjs/dd_2.php
Any shinning Ext.dd example?
jsakalos
05-11-2007, 02:23 PM
Re 3: I do not have time to modify the following to be more understandable, but I guess it can help.
// setup DragSource
if(this.persData) {
if(!this.persDDS) {
var persDiv = Ext.get(this.persNode.dom.firstChild);
this.persDDS = new Ext.dd.DragSource(persDiv, {
ddGroup: 'person'
, dragData: this
});
this.persDDS.addToGroup('trash');
this.persDDS.onStartDrag = function() {
// modify the drag ghost to contain not only icon but also full name
var node = Ext.get(this.proxy.ghost.select("[@class*='ob-node-pers-false']"));
if(!node.elements.length) {
var node = Ext.get(this.proxy.ghost.select("[@class*='ob-node-pers-true']"));
}
if(node.elements.length) {
node.update(this.dragData.persData.persFullName);
node.set({style:'background-position:0 0'});
}
};
}
}
moraes
05-12-2007, 01:27 PM
Re 3: I do not have time to modify the following to be more understandable, but I guess it can help.
It helped a bit, yes, thank you. :)
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.