Resizable columns not working

UI Components for Angular
Post Reply
MarkRuf
Posts: 2
Joined: 08 Jan 2019, 17:57

08 Jan 2019, 18:07

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

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

09 Jan 2019, 08:56

Hi.
i couldn't duplicate. Can you provide stackblitz case ? https://stackblitz.com/github/primeface ... e-template

MarkRuf
Posts: 2
Joined: 08 Jan 2019, 17:57

09 Jan 2019, 10:29

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!

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

09 Jan 2019, 11:29

Glad to hear.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests