Editing on datatable cell doesn't work with selectionmode
Hello,
I am playing around with the primeng datatable. When I enable both the "SelectionMode” and “editable” properties to true on datatable, editing on cell doesn’t work, only selection does. As soon as I remove the selectionmode property, editing works. Either row selection or editing cells would work at a time. How can we get both working together?
Thanks.
found a workaround for this
just use rowClick & remove selectionMode
then your function that reacts on event
onRowClick(e:any) {
this.selection = e.data;
]
on your datatable:
<p-dataTable (rowClick)="onRowClick($event)"
editable="true" [(selection)]="selection">
</p-dataTable>
this way you still have selection functionality + editable functionality
@Goldflow, Thanks for your response. For now I am using checkbox to do row selection. This way selection and editing work together.
The event is now called onRowClick (PrimeNg 4.0.3), but workaround still working.
<p-dataTable (onRowClick)="onRowClick($event)"
editable="true" [(selection)]="selection">
</p-dataTable>