Hello,
I am using DataTable row editing :
<p-table [value]="cars2" dataKey="vin" editMode="row">
How can I allow only one row edit at a time ?
Best Regards.
DataTable row editing how to allow only one row edit at a time
component.html
component.ts
Code: Select all
<button
*ngIf="!editing"
pButton
pRipple
type="button"
pInitEditableRow
icon="pi pi-pencil"
(click)="onRowEditInit(data)"
class="p-button-rounded p-button-text"
></button>
component.ts
Code: Select all
export class Component implements OnInit {
@ViewChild(Table) private dataTable: Table;
constructor(){}
Code: Select all
public onRowEditInit(data:DataModel) {
this.dataTable.editingRowKeys = {[data.id]:true}
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests