Change context menu options before showing

UI Components for Angular
Post Reply
efepege
Posts: 10
Joined: 02 Feb 2018, 18:16

15 Feb 2018, 11:07

Hi!

I'd like that some options of a p-contextMenu were visible only if a condition happens. For example, the option 'Paste' should only be visible if the user has clicked on the 'Copy' or 'Paste' options. Is there any way I can do it?

Thanks!

User avatar
Ctrl-C
Posts: 97
Joined: 29 Sep 2016, 04:21

15 Feb 2018, 18:20

You can try something like this:

Code: Select all

this.menuItems = [
  {label: 'Item 1', disabled: isDisabled}
];

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests