ngx-datatable with Draggable Rows

38 Views Asked by At

I am trying to implement the drag and drop functionality for but it doesnt work. The structure of my code is as below:

  <ngx-datatable class="material" [columnMode]="ColumnMode.force"
      [headerHeight]="50" [footerHeight]="0" [sortType]="SortType.single" [rowHeight]="32" [treeFromRelation]="'padre'"
      [treeToRelation]="'id'" [rows]="rows" (treeAction)="onTreeAction($event)" [rowClass]="getRowClass"
      [scrollbarH]="true" [scrollbarV]="true" [limit]="17" [reorderable]="true">
         <ngx-datatable-column [cellClass]="getCellClass" [frozenLeft]="true" name="Livello" prop="livello" [flexGrow]="1"
        [width]="50"></ngx-datatable-column>

      <ngx-datatable-column>....   </ngx-datatable-column>
</ngx-datatable>

I installed @angular/cdk/drag-drop and added the

cdkDrag
        [cdkDragData]="row"
        (cdkDragStarted)="onDragStarted()"
        (cdkDragEnded)="onDragEnded()"
        (cdkDragDropped)="drop($event)"

in the beginning but it didn't work.

0

There are 0 best solutions below