PDA

View Full Version : How to get the row index of a grid having only a XY position ?



david.p
17 Jul 2012, 6:24 AM
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 ?)

sword-it
22 Jul 2012, 4:20 PM
Hi,

Could you please send a piece of your code in order to understand your problem more specificly.

Thx

robertocarvajal
9 Aug 2012, 2:10 PM
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.