Reorder mat-table rows with angular material's drag-and-drop

后端 未结 5 1342
天涯浪人
天涯浪人 2020-12-29 08:59

Angular 7 brought the powerful DragDropModule with it: https://material.angular.io/cdk/drag-drop/examples

The documentation deals with rearranging items

5条回答
  •  温柔的废话
    2020-12-29 09:13

    I found a very good example on stackblitz: https://stackblitz.com/edit/table-drag-n-drop

    To not break the ui of the Drag&Drop preview, use the tags

    ...
    ...
    ...
    ...
    ...
    

    instead of

    ...
    ... ... ... ...

    Combined with the css mentioned in https://stackoverflow.com/a/53630171/12331146 it is the perfect solution for me.

提交回复
热议问题