I’m wanting to sexy up an app of mine and would like to mouse click on a cell in “Grid A” and drag the cell contents visually over the screen to a cell in “Grid B”. I was working on a label appearing on “mousedown” and moves with mouse and disappears on “mouseup” of receiving grid.
I’ve got the label "dropping on to the receiving grid cell ok. My problem is when I mousedown on the data source grid, I can get the cell info and set the label correctly, and move the label to where the cell is, but I currently need to release the mouse and select the label to drag it. I would like to drag the label from the first mousedown event. Doable?
Put the label container inside the draggable container. On mouse down unhide the label container. The label will automatically go with the draggable container and the on mouse up hide the label container.
You can alternately append the label container and remove it vs show/hide.
I tried what I think you advised. Put a container on top of the grid? It moves nicely but how do I know which cell in the grid the user wants to drag? As the Grid_onmousedown is not being triggered now obviously.
Really appreciate the help PPeTree but I’m a bit clueless in Javascript and don’t really know what to do with your suggestion sorry. Learnt Basic and never needed to branch out further.
I’ve bypassed using a dragable label and am now using onmousemove,down,over etc with success. My only issue now is when the grid starts scrolling, moving the label off grid also scrolls the grid. How do you stop a grid from scrolling in code? Needs to scroll normally then when dragging the label off it needs to stay still.
I think I’m looking for the same answer as this post is looking for…
The event is Grid_onmousedown() which I have the code that Label.shows() and moves the label with the mouse cursor. What I think I need is the code to set Grid scrollY: &, scrollX: to false in Grid_onmousedown() then to true when the Label_onmouseup function calls.
I got this to do the scroll disabling but it resets the grid back to row 0. Really needs to leave the grid where it is. Anyone know what might need doing to do that?