Tree drag and drop

Hello Webix team,

https://snippet.webix.com/4ukpt1h2

In above snippet, on drag event I want the top position of my dragged element. How can I get that?

Thanks

Hey @leod1481, could you elaborate a little bit please? Do you mean you want to get the parent of the currently dragged element? Or do you mean you want to get the parent after the folder was dropped?

If you are talking about the second case, you can get the parent element in the onAfterDrop event: https://snippet.webix.com/zh6h7zot.

HI Dzmitry,

I am trying to scroll my page on drag event for that I will require vertical height of my element on drag event.

Eg If I am dragging 3-Accordion element, I want its top position value. How can I calculate that.

You can get the current mouse position (which essentially means getting the position of the currently dragged element) from the Mouse event that is being passed inside the onBeforeDragIn event: https://snippet.webix.com/wjbg4hdc.

HI Dzmitry,

You are providing the position of element on onBeforeDragIn, but I want the actual current position of element on drag event(i.e. where ever element will be dragged I want its position at that instance).

There is no an ondrag event of sorts, the best you could do is use both the onBeforeDragIn and onDragOut: https://snippet.webix.com/7exdjvcx.