I face an issue about Datatable Editor
My table is datatable of PrimeNG, this table can edit any cell of row and all cell is required:
here is the requiment of Datatable:
when I finished 2 requirements, the datatable raise up an issue, and this issue is in the image below
please help me out of this issue
and here is Plunker
Here is the importance of Code:
<input [(ngModel)]="data[col.field]" pInputText required="true" [name]="col.field" />
if I add attribute [ngModelOptions]="{standalone: true}"
the issue will be resolved but the validation will be removed.
You just made a mistake in the name
attribute. Replace
<input [(ngModel)]="data[col.field]" pInputText required="true" [name]="col.field" />
with
<input [(ngModel)]="data[col.field]" pInputText required="true" [name]="data[col.field]" />
In your case, col.field
equals name so for the whole first column, all your inputs have the same name hence the problem.