How to get the row index of a grid having only a XY position ?
How to get the row index of a grid having only a XY position ?
I'm trying to get the row index of a grid when I drag&drop an image into it.
For esthetic reasons, the drag element has no offset, so when I move it, it sticks right under the mouse cursor. This is not negociable.
Consequently on the nodeDrop event, the result of event.getTarget() is actually the dragged image
So basically I only have got the event.getXY() to know where the image is dropped.
So I need to know how to get the rowIndex of a grid having only an XY position ? (Unless someone know how to get the event target beyond the dragged image ?)
try with gridview.indexOf(node) it will return the index of that particular node, you can get the node either by doing something like gridview.getSelectedNodes()[0] (first selected node) or if you are using the dragdrop plugin, the drop event of the plugin also passes the affected node.