reppners / ngx-drag-drop

Angular directives using the native HTML Drag And Drop API
https://reppners.github.io/ngx-drag-drop/
BSD 3-Clause "New" or "Revised" License
299 stars 118 forks source link

Question - how to get data where I dropped data? #89

Closed profeciak closed 2 years ago

profeciak commented 4 years ago

Is your feature request related to a problem? Please describe. I'm moving a task from one phase to another. I'm not sure how can I achieve the phase data to which I dropped my task. I specially need the id of the new phase. Inside the DndDropEvent I have all object that I move, but I'm lacking data of object to which I move

pavittar95 commented 3 years ago

@reppners I got the same issue.

esmaeilpour commented 3 years ago

According to documents, you can have access to data like this event.dataTransfer?.getData('application/x-dnd')

reppners commented 2 years ago

The context of your dropzone should carry this information. I'd imagine your dropzones are the containers for the phases and your drop handler basically should have this information implicitly or you need to provide it in your component code. If the dropzones are dynamically rendered with a ngFor then the model used for the ngFor needs to carry this information and from there it can be easily passed to the drop handler invocation. If you need a code example I can come up with something.