Can I get index of items in gridster2 after dragging

466 Views Asked by At
I just want a index of items of get both source and target items :
1.drageed item
2.on which item it is dropped

is there any way to getting index.

I tried itemChangeCallback - it gives me 2 times which are exchange with each other but it doesn't give me the indexes of them

1

There are 1 best solutions below

1
Dae Hyeon Mun On

Try code below :D

const droppedItem = document.getElementById(".dropped");
const index = items.findIndex(item => item.id === droppedItem.id);
console.log(index);