我使用 SmartGWT 3.0,我需要在 a 中检测到外部的一滴Label
,TreeGrid
我尝试了很多方法来做到这一点,但都没有奏效。在一个Canvas
我可以做下降,但TreeGrid
没有检测到下降。有没有办法做到这一点?
TreeGrid tileGrid = new TreeGrid();
tileGrid.setAlign(Alignment.CENTER);
tileGrid.setWidth(300);
tileGrid.setHeight(300);
tileGrid.setCanAcceptDrop(true);
tileGrid.addDropHandler(new DropHandler() {
@Override
public void onDrop(DropEvent event) {
Window.alert("drop");
}
});
Canvas cv = new Canvas();
cv.setBorder("1px solid #CCCCCC");
cv.setWidth(300);
cv.setHeight(300);
cv.setCanAcceptDrop(Boolean.TRUE);
cv.addDropHandler(new DropHandler() {
@Override
public void onDrop(DropEvent event) {
Window.alert("drop event"+event.toString());
}
});
Label lb = new Label("Drag me");
lb.setCanDrag(true);
lb.setCanDrop(true);
lb.setDragAppearance(DragAppearance.TARGET);
// added the components to a HLayout
panel.addMember(tileGrid);
panel.addMember(cv);
panel.addMember(lb);
panel.draw();