Identifying targetList in ember-drag-sort

亡梦爱人 提交于 2019-12-12 04:42:56

问题


I am currently trying to implement an ember-drag-sort nested list into my Ember.js app.

Is there a way to determine in the dragEnd action which "sub-list" the item has been dropped into? (e.g. a class name, id etc)

In my scenario, I am sorting ember data records that can belong to each other (i.e. a nested, 'tree' structure). When I drag one nested record "into" another (making the dragged record a child of the second record), I need to update the parent attribute in ember-data. My question is, how do you pass some id of the second record (the new parent) to the dragEnd action?

Is this even possible?


EDIT:

To put it another way, I want to be able to identify which list I have dropped the item into.


回答1:


targetList refers to the array on the dragged side of the component. For pushing the parent to the target list alongside the child, you can take a look at this twiddle.



来源:https://stackoverflow.com/questions/47257603/identifying-targetlist-in-ember-drag-sort

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!