mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
update doc (#8386)
This commit is contained in:
@@ -7,10 +7,9 @@ Last reviewed: 2023-01-01
|
||||
|
||||
# [Datatable service](../../../lib/core/src/lib/datatable/services/datatable.service.ts "Defined in datatable.service.ts")
|
||||
|
||||
|
||||
## Details
|
||||
|
||||
If you need to update one row of your datatable you can use the ```DataTableService``` to update it.
|
||||
If you need to update one row of your datatable you can use the [`DataTableService`](../../../lib/core/src/lib/datatable/services/datatable.service.ts) 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
|
||||
|
||||
@@ -22,11 +21,13 @@ DataRowUpdateModel {
|
||||
```
|
||||
|
||||
For example if your table use entry nodes you can pass:
|
||||
|
||||
```typescript
|
||||
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
|
||||
As good practice is better to provide a [`DataTableService`](../../../lib/core/src/lib/datatable/services/datatable.service.ts) in the component where you are going to deliver the new object
|
||||
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'app-files-component',
|
||||
@@ -48,7 +49,6 @@ export class FilesComponent implements OnInit {
|
||||
this.dataTableService.rowUpdate.next({id: node.id, obj: {entry: node}});
|
||||
});
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## See also
|
||||
|
Reference in New Issue
Block a user