Page 1 of 1

Resizable columns not working

Posted: 08 Jan 2019, 18:07
by MarkRuf
Hi,
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>
Thank you!

Marco

Re: Resizable columns not working

Posted: 09 Jan 2019, 08:56
by yigitfindikli
Hi.
i couldn't duplicate. Can you provide stackblitz case ? https://stackblitz.com/github/primeface ... e-template

Re: Resizable columns not working

Posted: 09 Jan 2019, 10:29
by MarkRuf
Hello,

I have found the solution, in my computer I didn't have all the style components, these files was missing:

not_modules/primeng/resources/themes/nove-light/theme.css
not_modules/primeng/resources/themes/primeng.min.css
not_modules/primeicons/primeicons.css

Any idea why it happend? Have I miss something when I have installed the npm package?

Thanks!

Re: Resizable columns not working

Posted: 09 Jan 2019, 11:29
by yigitfindikli
Glad to hear.