1

我有这个角度代码,它显示 2 个列表并在它们之间移动项目。当一个项目从可用列表移动到我尝试使用的选定列表时,我需要调用一个方法,(click)="refresh();"但是它在任何点击时运行该方法,我需要在从左到右移动项目时专门运行它

<p-pickList (click)="refresh();" [source]="available" [target]="selected" sourceHeader="Available" targetHeader="Selected" [responsive]="true" filterBy="type" 
        dragdrop="true" dragdropScope="items" sourceFilterPlaceholder="Search by name" targetFilterPlaceholder="Search by name" [sourceStyle]="{'height':'300px'}" [targetStyle]="{'height':'300px'}">

    <ng-template let-items pTemplate="item">
        <div class="ui-helper-clearfix">
            <div style="font-size:14px;margin:15px 5px 0 0">{{item.type}}</div>
        </div>
    </ng-template>
</p-pickList>
4

1 回答 1

1

您需要调用onMoveToTarget方法,onMoveToSource反之亦然,而不是调用(click)事件。

从文档中阅读更多信息

于 2018-05-03T10:35:31.527 回答