PrimeNg Context Menu Example

Today, I want to talk about PrimeNg ContextMenu. Context Menu property is very usefull for PrimeNg table  operations. Let’s make a PrimeNg Context Menu Example. First we must prepare the html code below.

We connect the table to contextmenu with  [contextMenu]=”cm” in p-table.  In this example, our goal is to change the headers  with right click.  We will add this code to typescript file.

We can write the event code to the “this.selectHeaderMenu “. Then we can change the header in the function excelChoose. That’s just all. It is very easy and simple to change headers in PrimeNg ContextMenu with this example.  If you want to see another post about PrimeNg table, have a look to this PrimeNg Table

You may also like...

3 Responses

  1. Darryl Pierce says:

    Do you have an example for adjusting the width of the ContextMenu to accommodate longer entries?

  1. March 11, 2019

    […] You should have a look at my another post about When To Use Try-Catch In C# […]

  2. March 11, 2019

    […] That’s all. You can also use ProgressSpinner instead of ProgressBar as you wish. You should have a look at my another post about PrimeNg ContextMenu […]

Leave a Reply

Your email address will not be published. Required fields are marked *