View Full Version : drag and drop between datalist
nitipatil
25 Jun 2008, 7:13 PM
Hi all..
Is there any way I could able to make listitem as draggable and another datalist as droppable and make drag and drop possible in GXT.
Thanks,
Nitin
gslender
26 Jun 2008, 12:17 AM
I don't believe item level drag/drop is supported at this stage... but I believe it is planned.
Rvanlaak
7 May 2009, 1:44 AM
For now, I think this function is implemented. But how can I drag from a datalist to an other component (like a button)? Looks like the datalist SelectionMode is blocking the event...
Rvanlaak
12 Jun 2009, 6:17 AM
I don't believe item level drag/drop is supported at this stage... but I believe it is planned.
The drag & drop is succesfully implemented at DataLists. I've succeeded to DnD from lists to buttons, but now I'm trying to DnD between two lists of the same class with the following code:
DropTarget target = new DropTarget(list) {
@Override
protected void onDragDrop(DNDEvent event) {
super.onDragDrop(event);
redirectFromChannel((String)event.getData());
}
};
target.setGroup("dnd-call");
target.setOverStyle("drag-ok");
DragSource source = new DragSource(list) {
@Override
protected void onDragStart(DNDEvent event) {
QueueItem item = (QueueItem) list.getSelectedItem();
event.setData(item.getChannel());
event.getStatus().update(item.getCallerIdName());
System.out.println("asdfasdfasdf");
}
};
source.setGroup("dnd-call");
The println appears when the DnD starts, but the setOverStyle doesn't work. It seems like I'm using the wrong DnD target...
Rvanlaak
12 Jun 2009, 6:23 AM
Mmm,, I've solved it already.
It seems that when Datalists are empty, the height is 0px when it isn't using any layout. For now, I've added a BorderLayout to the container wich contains the list, and add the list by using BorderLayoutData(Orientation.CENTER)
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.