Skip to content

Commit

Permalink
docs(module:table): reset edit cache when cancel (#2748)
Browse files Browse the repository at this point in the history
  • Loading branch information
loyaltyoffire authored and hsuanxyz committed Jan 8, 2019
1 parent 3f07279 commit 3d935bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/table/demo/edit-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export class NzDemoTableEditRowComponent implements OnInit {
}

cancelEdit(key: string): void {
const index = this.dataSet.findIndex(item => item.key === key);
Object.assign(this.editCache[ key ].data, this.dataSet[ index ]);
this.editCache[ key ].edit = false;
}

Expand Down

0 comments on commit 3d935bd

Please sign in to comment.