I am currently building an Angular application with PrimeNG as the UI Library. I have built a p-table with data and have made it editable with p-dropdowns. These p-dropdowns are binded to change the ngModel. I am having trouble changing the style of the td after making a change to the ngModel using the p-dropdown in the cell of the p-table.
Is there a way I can do this? I was thinking of either being able to style the td or the outputted div in the p-cellEditor. I'd like to change the style add a red border on the td on change of the ngModel.
Here is my code:
<p-table [value]="current.values">
<ng-template pTemplate="body" let-value>
<tr>
<td pEditableColumn *ngFor="let field of fields" style="">
<p-cellEditor>
<ng-template pTemplate="input">
<p-dropdown [options]="options" [(ngModel)]="value[field]" appendTo="body"
(ngModelChange)="value, field" required>
</p-dropdown>
</ng-template>
<ng-template pTemplate="output">
<div style="">
{{value[field]}}
</div>
</ng-template>
</p-cellEditor>
</td>
</tr>
</ng-template>
</p-table>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…