0

I was trying to implementing draging and dropping in both direction using angular CDK and Grid Layout. So i am keeping the elements under cdkDropListGroup to connect the all cdkDropList. Now i want to disable sorting among the elements. I tried using cdkDropListSortingDisabled but it's not working. Is their any way to do it?

<div cdkDropListGroup class="grid-layout-styles example-list">
    <div [ngStyle]="getStyle(item)"  cdkDropList cdkDropListSortingDisabled
         *ngFor="let item of items" [id]="item.id">
         <div class="example-box" cdkDrag>{{item.title}}</div>
    </div>
</div>
Shakibuz_Zaman
  • 260
  • 1
  • 14
  • well it should work, have you seen the example: https://material.angular.io/cdk/drag-drop/examples#cdk-drag-drop-disabled-sorting Whats the difference compared to your scenario? – Zerotwelve Apr 25 '22 at 06:53
  • What happens if replacing `cdkDropList ` to `[cdkDropList]="items"`? – N.F. Apr 25 '22 at 07:03
  • @N.F. It's giving error " Can't bind to 'cdkDropList' since it isn't a known property of 'div'." – Shakibuz_Zaman Apr 25 '22 at 07:20
  • @Zerotwelve Actually in the following example "Available Items" and "Shopping basket" represents two cdkList groups. And under both cdkList group there are multiple item. But in my case each element represent a cdkList item. You can see in the material that the loop is not with the cdkDropList. It's inside the cdkDropList. But in my case the loop is with the cdkDropList. – Shakibuz_Zaman Apr 25 '22 at 07:20
  • see: https://stackoverflow.com/questions/63259720/error-when-using-cdkdroplistdata-in-angular-gives-me-cant-bind-to-cdkdroplistd – Yoni A Apr 25 '22 at 07:25

0 Answers0