unable to add the element at specific index in dropped items.
opened this issue · comments
Hi,
I want to add the element to a specific position in the list (i.e. in between element 'A' and 'B' I want to add element 'X'). But in the onDrop event, I'm not getting anything like the index to add the element into specific position at "dropped items"
can anybody tell me how to add an item to a specific index of dropped items?
This feature is currently in development. Closing as Duplicate of #12
Hi ObaidUrRehman,
Thanks for your updated. I have resolved this issue.
Steps:
- I'm getting closest element where I drop the element.
var id = element.nativeEvent.target.closest('li').getAttribute('Id'); - im find the index of the item in list and pushing item into list from "element.dragData"
this.ListItems.splice(i, 0, element.dragData);