简体   繁体   中英

jquery start dragging object when clicked on the other with gwtquery and drag and drop

In this post the question is asked how to initiate an immediate drag operation when another object is clicked. I have the same question but in the context of gwtquery and the draggable plugin.

In the reference post the new item to be dragged is moved to be under the click point and the original mouse down event is sent on to it. Is it possible to do this in gwt?

You should be able to do something like that :

$("#myDraggable").as(Draggable).draggable();
$("#myOtherDiv").mousedown(new Function(){
@Override
public boolean f(Event e) {
    //position your draggable first
    //...
    $("#myDraggable").trigger(e);
    return false;
}
});

But the method trigger(Event e) doesn't exist yet in GQuery. I open an issue for covering that : http://code.google.com/p/gwtquery/issues/detail?id=139

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM