簡體   English   中英

Angular Material表拖放列排序不正常

[英]Angular Material table drag and drop columns with sorting not wroking

帶排序的角度材料表無法通過拖放正常工作。

這是我到目前為止所得到的,它有點適用於在拖放后排序與特定列一起工作的地方。 但仍然有奇怪的功能。

堆棧閃電戰

我希望能夠使用材料表的正常排序功能,同時能夠拖放列。

matSort需要在mat-table元素上

<mat-table [dataSource]="dataSource" class="mat-elevation-z8" cdkDropListGroup matSort>

而不是在ng-container

<mat-table [dataSource]="dataSource" class="mat-elevation-z8" cdkDropListGroup>
  <ng-container *ngFor="let column of columns; let i = index" [matColumnDef]="column.field" matSort>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM