Angular 7 Drag and Drop - Dynamically Create Drop Zones

后端 未结 6 725
无人及你
无人及你 2021-01-31 18:12

Is there a way to dynamically create drop zones? I\'m having some troubles with ngFor and cdkDropList.

Here is my first list and draggable elements:

           


        
6条回答
  •  遇见更好的自我
    2021-01-31 18:50

    I've built a stackblitz example using a dynamic group of lists and cdkDropListGroup. I'm memorizing the first list's name on the item in the list. By memorizing the first list I can track which objects have changed, which can be handy for building some cases. It also gives me the possibility to change the background color of the items that have moved, clearly showing what's changed.

提交回复
热议问题