sample.html ----------- <p-treeTable [value]="childAnnual" [columns]="cols"> <ng-template pTemplate="header" let-columns> <tr> <th *ngFor="let col of cols"> {{col.header}} </th> </tr> </ng-template> <ng-template pTemplate="body" let-rowNode let-rowData="rowData" let-columns="columns"> <tr> <td *ngFor="let col of childAnnual; let i = index" ttEditableColumn [ngClass]="{'ui-toggler-column': i === 0}"> <p-treeTableToggler [rowNode]="rowNode" *ngIf="i === 0"></p-treeTableToggler> <p-treeTableCellEditor> <ng-template pTemplate="input"> <input pInputText type="text" [(ngModel)]="rowData[col.field]" [ngStyle]="{'width': i == 0 ? '90%': '100%'}"> </ng-template> <ng-template pTemplate="output">{{rowData[col.field]}}</ng-template> </p-treeTableCellEditor> </td> </tr> </ng-template> </p-treeTable>
component.ts ------------ myfiles: TreeNode[] = [ { data: { name: 'Cloud', size: '20mb', type: 'Folder', }, children: [ { data: { name: 'backup-1.zip', size: '10mb', type: 'Zip', }, }, { data: { name: 'backup-2.zip', size: '10mb', type: 'Zip', }, },], }, { data: { name: 'Desktop', size: '20mb', type: 'Folder', }, children: [ { data: { name: 'backup-1.zip', size: '10mb', type: 'Zip', }, }, { data: { name: 'backup-2.zip', size: '10mb', type: 'Zip', }, },], } ]; -- 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 angular+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/b03534d9-0f00-4a2b-b7fd-1871ad00da90%40googlegroups.com.