Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by sandro on Jan 11, 2008 19:37
open dhtmlx forum
right click drag

using a grid, using extended drag mode. the grid has a context menu, on right click. i'm finding that the user, when right-clicking and moving the mouse, initiates a drag, creating a drag object (1 message, etc), and often latent drag objects or context menus that never close. a very strange bug.

the question is simple. i want to only initiate drag when user is clicking the LEFT mouse button, and to only have the context menu appear with RIGHT click. How do i do that?

great product

sandro
Answer posted by Support on Jan 14, 2008 02:27
By default component allow the drag with any mouse button , but you can block drag by right click with next code modification

dhtmlxcommon.js , line 268

    dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e)
    {
        if (window.dhtmlDragAndDrop.waitDrag) {
             window.dhtmlDragAndDrop.waitDrag=0;
             document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;
             document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;
             return false;
        }
        if (((e||event)||{}).button==2) return; //   <<<<next line added
        window.dhtmlDragAndDrop.waitDrag=1;