getRowIndex Bug

dhtmlx.com/docs/products/dhtmlxG … vents.html

if one uses mygrid.getRowIndex(r1) or mygrid.getRowIndex(r2) inside of the onDrop event function, these indexes seem to be way off after the initial try (when you moved them around a few times). Suspect there is a bug here.

Can you please provide code example where we can reproduce this issue, steps to reproduce and expected results?

In the above example, if one changes
function drop_f(r1, r2) {
var i1 = mygrid.getRowIndex(r1);
var i2 = mygrid.getRowIndex(r2);
document.getElementById(“logBox”).innerHTML += "Item " + r1 + " droped on item " + r2 + “
” +
"Index " + i1 + " droped on index " + i2 + “
”;
}
Drag the last row to first row couple of times, you get:

Item 10 droped on item 1
Index 1 droped on index 0
Item 9 droped on item 1
Index 1 droped on index 0

It always thinks that the last row is has an index of 1.

Can you re-produce the bug I have reported? This is an import feature for us, we like to have it work soon.

On a related note, I noticed for column move drag and drop, the event function returns start and end column indexes, which are the right ones we like to use. But for row move drag and drop the event function returns the row ids which are harder for us to use. Is it possible to have it reporting row indexes instead? Thank You!

drop_f - called when rows already moved , so it return final indexes of the rows, not original values. You need to place your logic in drag_f ( onDrag event ) - here it will return valid row indexes.

Is it possible to have it reporting row indexes instead
You always can use getRowIndex to convert rowId to the rowIndex

Thanks!