If you need to update one row of your datatable you can use the DataTableService
to update it.
To update a single row you can use the rowUpdate subject.
The model to update the DataTable require the ID of the row you want change and the new data Object of the row
DataRowUpdateModel { obj: any; id: string; }
For example if your table use entry nodes you can pass:
this.dataTableService.rowUpdate.next({id: node.id, obj: {entry: node}});
As good practice is better to provide a DataTableService
in the component where you are going to deliver the new object
@Component({
selector: 'app-files-component',
templateUrl: './files.component.html',
styleUrls: ['./files.component.scss'],
encapsulation: ViewEncapsulation.None,
providers: [
DataTableService
]
})
class FilesComponent implements OnInit {
constructor(private dataTableService: DataTableService,
private nodeService: NodesApiService) {
}
ngOnInit() {
this.nodeService.nodeUpdated.subscribe((node) => {
this.dataTableService.rowUpdate.next({id: node.id, obj: {entry: node}});
});
}
© 2023 Alfresco Software, Inc. All Rights Reserved.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.