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
307 stars 120 forks source link

set dndType on drop in a restricted div. #23

Closed selva98 closed 6 years ago

selva98 commented 6 years ago

I m following a typed demo where i am having multiple value in dropzone ie array and when i drop a li in this div its setting the first one in dropzone attribute array but i would like set my self for dndType. I have searched but i didn't get what i m trying, can you help me how i can achieve this.

reppners commented 6 years ago

I'm not entirely clear I can follow your question and use case description.

Please provide a minimal example of your use case based on this https://stackblitz.com/edit/ngx-drag-drop-issue-template

selva98 commented 6 years ago

Thanks for a soon reply , i m new bee , can we manually set the dndType on Drop event, current it was setting last value of array ng-reflect-dnd-dropzone in ul into li ng-reflect-dnd-type attribute but i need to set it manually , for example in dropzone i ve 5ad6ff051de3a249f832a4c5, 5ad70b1d1de3a223a89e97e6 5af02bd21de3a20a34fede43 and when i drop element having dndType 5ad70b1d1de3a223a89e97e6 , it was setting dndType to 5af02bd21de3a20a34fede43 but i need dndType to be 5af02bd21de3a20a34fede43

reppners commented 6 years ago

dndType can be set through angular data binding so you should be able to update the bound component value based on your application logic requirements dynamically, e.g. on drop.

I'm still not understanding what your requirement is though.

Please provide a stackblitz with minimal reproduction where you provide detailed comments what is not working the way you intend, otherwise I'm not able to help you.

selva98 commented 6 years ago

Thanks Stefan,The problem was solved , i m checking the element which is already in the dom instead of drop element, this problem raised mainly because of data's in the element are almost same so i unexpectedly checking the element in the second position instead of dropped on which is in first position in list.

reppners commented 6 years ago

Good 👍 Closing as solved 😀