I have a problem using the resizable feature, I've used exactly the code showed in the demo but it doesn't work, the table is ok but the resize cursor doesn't appear and it doesn't work, am I missing something big here?
Angular version: 7.1.2
Primeng version: 7.0.4
This is the code I'm using:
Code: Select all
export class TableColResizeDemo implements OnInit {
cars1: Car[];
cols: any[];
constructor() { }
ngOnInit() {
this.cars1 = {[ vin: x, year:x, brand: x, color: x]};
this.cols = [
{ field: 'vin', header: 'Vin', width: '25%'},
{ field: 'year', header: 'Year', width: '15%' },
{ field: 'brand', header: 'Brand', width: '35%' },
{ field: 'color', header: 'Color', width: '25%' }
];
}
}
Code: Select all
<p-table [columns]="cols" [value]="cars1" [resizableColumns]="true">
<ng-template pTemplate="header" let-columns>
<tr>
<th *ngFor="let col of columns" pResizableColumn>
{{col.header}}
</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-columns="columns">
<tr>
<td *ngFor="let col of columns" class="ui-resizable-column">
{{rowData[col.field]}}
</td>
</tr>
</ng-template>
</p-table>
Marco