TurboTable: how to set optional attributes?

UI Components for Angular
Post Reply
kareljanvh
Posts: 1
Joined: 26 Apr 2016, 15:45

12 Feb 2018, 11:19

I'm tying to set the pReorderableColumn attribute of the columns with a col.reorder parameter in the columns list.
So this i my data:

Code: Select all

public cols = [
    { field: 'Avatar', header: 'Avatar', reorder: false, resize: false, sort: false },
    { field: 'FirstName', header: 'Firstname', reorder: true, resize: true, sort: true },
    { field: 'LastName', header: 'Lastname', reorder: true, resize: true, sort: true },
    { field: 'Department', header: 'Department', reorder: true, resize: true, sort: true },
    { field: 'Function', header: 'Function', reorder: true, resize: true, sort: true },
    { field: 'UserRole', header: 'Role', reorder: true, resize: true, sort: true },
    { field: 'AccessLevel', header: 'Access Level', reorder: true, resize: true, sort: true }
  ];
I'm also trying to do the same for resize and sort.
So the code below is not working because it returns the attribute all lowercase.

Code: Select all

	<p-table [value]="searchResult"  [reorderableColumns]="true" #dt>
		<th *ngFor="let col of cols" [attr.pReorderableColumn]="col.reorder?'':null">
                        {{col.header}}
                </th>
	</p-table>
Also this is not valid. Although this would be preferred.

Code: Select all

	<p-table [value]="searchResult"  [reorderableColumns]="true" #dt>
		<th *ngFor="let col of cols" [pReorderableColumn]="col.reorder">
                        {{col.header}}
                </th>
	</p-table>
So is there a way to set the pReorderableColumn parameter with a dynamic list of columns?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Mar 2018, 22:57

With 5.2.1, there is;

Code: Select all

[pReorderableColumnDisabled]="condition"
https://github.com/primefaces/primeng/issues/5243

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests