Skip to content

Commit

Permalink
fixed #2573
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtcndkn committed Jun 2, 2017
1 parent daf1baa commit 686a216
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/picklist/picklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ export class PickList implements OnDestroy,AfterViewChecked,AfterContentInit {

@Output() onMoveToSource: EventEmitter<any> = new EventEmitter();

@Output() onMoveAllToSource: EventEmitter<any> = new EventEmitter();

@Output() onMoveAllToTarget: EventEmitter<any> = new EventEmitter();

@Output() onMoveToTarget: EventEmitter<any> = new EventEmitter();

@Output() onSourceReorder: EventEmitter<any> = new EventEmitter();
Expand Down Expand Up @@ -276,10 +280,17 @@ export class PickList implements OnDestroy,AfterViewChecked,AfterContentInit {
for(let i = 0; i < this.source.length; i++) {
this.target.push(this.source[i]);
}

this.onMoveToTarget.emit({
items: this.source
});

this.onMoveAllToTarget.emit({
items: this.source
});

this.source.splice(0, this.source.length);

this.selectedItemsSource = [];
}
}
Expand All @@ -295,6 +306,7 @@ export class PickList implements OnDestroy,AfterViewChecked,AfterContentInit {
this.onMoveToSource.emit({
items: this.selectedItemsTarget
});

this.selectedItemsTarget = [];
}
}
Expand All @@ -304,10 +316,17 @@ export class PickList implements OnDestroy,AfterViewChecked,AfterContentInit {
for(let i = 0; i < this.target.length; i++) {
this.source.push(this.target[i]);
}

this.onMoveToSource.emit({
items: this.target
});

this.onMoveAllToSource.emit({
items: this.target
});

this.target.splice(0, this.target.length);

this.selectedItemsTarget = [];
}
}
Expand Down
10 changes: 10 additions & 0 deletions showcase/demo/picklist/picklistdemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ <h3>Events</h3>
<td>event.items: Moved items array</td>
<td>Callback to invoke when items are moved from target to source.</td>
</tr>
<tr>
<td>onMoveAllToTarget</td>
<td>event.items: Moved items array</td>
<td>Callback to invoke when all items are moved from source to target.</td>
</tr>
<tr>
<td>onMoveAllToSource</td>
<td>event.items: Moved items array</td>
<td>Callback to invoke when all items are moved from target to source.</td>
</tr>
<tr>
<td>onSourceReorder</td>
<td>event.items: Moved items array</td>
Expand Down

0 comments on commit 686a216

Please sign in to comment.