On Thursday, June 29, 2017 at 11:22:24 AM UTC+2, [email protected] wrote: > > > I am showing some data in P-dataTable but i want to put input text field > on click on first row of table only (I am getting inout box but get > repeated through out of thee table). >
This should be really easy to achieve - give your column template the rowIndex and show the imput if the rowIndex === 0 - like this: https://plnkr.co/edit/yETk9NqbhQkcAfoaAVpA?p=preview Here's the relevant bit: <p-column field="Col1" header="Column 1" [sortable]="true" [style]="{'width': '200px'}"> <template let-data="rowData" let-ri="rowIndex" pTemplate="body"> <span *ngIf="ri !== 0">{{ data['Col1'] }}</span> <input type="text" *ngIf="ri === 0"> </template> </p-column> The important part is that *let-ri="rowIndex"* where you give your template the rowIndex. Disclaimer though, I don'tuse PrimeNG but I was curious so went and looked it up. -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
