表格排序后的Angular 5 ng-Dragula不拖动正确的行

时间:2018-03-22 17:08:22

标签: angular drag-and-drop ngdraggable

我的Angular应用程序中有两个表。在第一个表中,我使用Angular管道过滤记录,然后将这些过滤器行拖到第二个表中。但是在过滤器之后,不能拖动正确的行,即在拖动目标表之后显示一些其他行数据。任何人都可以帮我理解我在做什么。

源表是:        

        <tr *ngFor="let FineTunedData of FineTunedDatas | orderBy: key : reverse | familieFilter: family | searchfilter:filter | paginate: { itemsPerPage: 5, currentPage: f, id: 'f' };
          let i = index" (click)="setClickedRow(i)"  [class.active]="i == selectedRow" (click)="GetCustomerDetails(FineTunedData)" 
          >            
            <td class="th">{{FineTunedData.article_ID}}</td>
            <td class="th">{{FineTunedData.description}}</td>          
            <td class="th">{{FineTunedData.stockRAW}}</td>          
            <td class="th">{{FineTunedData.ordersRAW}}</td>
            <td class="th">{{FineTunedData.family}}</td>              
            <td class="th">{{FineTunedData.toProduceForecast}}</td>  
            <td class="th">{{FineTunedData.toProduce}}</td>

        </tr>
        <tr class="placeholder" *ngIf="!table1?.length > 0" id="no-drop">
            <td></td>
            <td></td>
            <td></td>  
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </tbody>

和目的地表是:

<tbody [dragula]='"bag"' [dragulaModel]='FineTunedDatas'> <tr *ngFor="let FineTunedData of FineTunedDatas let i = index" [class.active]="i == selectedRow" [attr.data-id]="i" (click)="getLSomeValue(i, FineTunedData)">
<td class="th">{{FineTunedData.article_ID}}</td> <td class="th">{{FineTunedData.description}}</td> <td class="th">{{FineTunedData.navisionCode}}</td>
<td class="th">{{FineTunedData.stockRAW}}</td>
<td class="th">{{FineTunedData.ordersRAW}}</td> <td class="th">{{FineTunedData.family}}</td> <td class="th">{{FineTunedData.toProduceForecast}}</td>
<td class="th">{{FineTunedData.toProduce}}</td>
</tr> <tr class="placeholder" dragHandle=".ui-panel-titlebar">
<td class="th"></td> <td class="th"></td> <td class="th"></td> <td class="th"></td> <td class="th"></td> <td class="th"></td> <td class="th"></td> <td class="th"></td>
</tr> </tbody> </table>

0 个答案:

没有答案