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
311 stars 121 forks source link

ngx-drag-drop for Primeng #141

Open Anshul-Pandey1 opened 1 year ago

Anshul-Pandey1 commented 1 year ago

I am trying to implement [ngx-drag-drop of typed component] the issue is I am using primeng and lists are made from angular material i don`t want to use them is there any possible way to make it work using list module of primeng only

`

Fruits
{{ fruit.type }} {{ fruit.id }}
Apples
{{ apple.type }} {{ apple.id }}
Bananas
{{ banana.type }} {{ banana.id }}

`

reppners commented 1 year ago

Hi, quickly looked through and it seems you are able to define your own template for items. When you define your own template it should enable you to add the necessary directives to the list items.

https://primeng.org/listbox#template

Anshul-Pandey1 commented 1 year ago

Thanks for response, can you please give me example how can I implment this <mat-list-item *ngFor="let fruit of fruits; let i = index; trackBy: trackByFruit" [dndDraggable]="fruit" [dndType]="fruit.type" (dndMoved)="onDragged(i, fruit, fruits)" class="border rounded-1 bg-white" dndEffectAllowed="move"> <span matListItemTitle>{{ fruit.type }} {{ fruit.id }}</span> </mat-list-item>

inside primeng list template <p-listbox [options]="countries" [(ngModel)]="selectedCountry" optionLabel="name" [listStyle]="{ 'max-height': '250px' }" [style]="{ width: '15rem' }">

{{ country.name }}