I have a data table that I have a context menu defined:
<p-table #table [value]="sites" [rows]="25" [paginator]="true" [pageLinks]="5" [rowsPerPageOptions]="[5, 10, 25, 50, 100, 250]"
[globalFilterFields]="['name', 'fullAddress', 'country']" [loading]="loading" loadingIcon="fa-spinner" [scrollable]="true" scrollHeight="600px" [responsive]="true"
[(contextMenuSelection)]="selectedSite" [contextMenu]="cm" [(selection)]="selectedSites" selectionMode="multiple">
And the p-contextMenu:
<p-contextMenu #cm [model]="items"></p-contextMenu>
I want to only allow the menu to be shown when rows are selected in the p-table. E.g.
<p-contextMenu *ngIf="selectedSites.length > 0" #cm [model]="items"></p-contextMenu>
But if I do this I get compilation error:
Property 'cm' does not exist on type 'GroupSummaryComponent'.
I've seen post that say this should work.
p-contextMenu not allowing *ngIf for showing context menu
-
- Posts: 18
- Joined: 19 Apr 2017, 23:28
I also need this. I need to show context menu only for 2 columns out of 10 columns in my p-datatable. But contextmenu is shown for all columns.
-
- Posts: 18
- Joined: 19 Apr 2017, 23:28
I also need this. I need to show context menu only for 2 columns out of 10 columns in my p-datatable. But contextmenu is shown for all columns.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 10 guests