Skip to content

Commit

Permalink
fix: implement refresh the data table on edit cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-rocket committed Oct 21, 2024
1 parent b5c9317 commit 0eb8b3b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ <h4>
[settings]="settingsSmartTable"
[source]="smartTableSource"
(editConfirm)="onEditConfirm($event)"
(editCancel)="onEditCancel($event)"
(userRowSelect)="onSelectEmployee($event)"
></angular2-smart-table>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,21 @@ export class JobEmployeeComponent extends PaginationFilterBaseComponent implemen
}
}

/**
* Handles the cancellation of an edit operation in the smart table.
* Refreshes the data table to reflect any changes made.
*
* @param event - The event object containing details about the canceled edit.
*
*/
onEditCancel(event: any): void {
// Optionally, you can log the event for debugging purposes
console.log('Edit canceled for row:', event);

// Refresh the data table to revert any changes made during the edit
this.smartTableSource.refresh();
}

/**
* Applies translations to the Smart Table settings when the language changes.
* This method listens for the onLangChange event from the translateService.
Expand Down

0 comments on commit 0eb8b3b

Please sign in to comment.