title: How to use Primeng Menu with command and parameters in DataTable?
body: <p>MenuItem of primeng has a parameter called command that is a function to be executed when its item is clicked. One example of using this is provided in <a href="https://www.primefaces.org/primeng/#/steps" rel="noreferrer">https://www.primefaces.org/primeng/#/steps</a> to give feedback to user. </p>
  
  <pre><code>command: (event: any) =&gt; {
                  this.activeIndex = 0;
                  this.msgs.length = 0;
                  this.msgs.push({severity:'info', summary:'First Step', detail: event.item.label});
              }
  </code></pre>
  
  <p>However, I want to use the MenuItem as a column of my Primeng DataTable, like this.</p>
  
  <p><a href="https://i.stack.imgur.com/wAxRh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wAxRh.png" alt="enter image description here"></a></p>
  
  <p>And for this I need to use my menu this way:</p>
  
  <pre><code>&lt;p-column&gt;
    &lt;ng-template let-item="rowData"
        &lt;p-menu #menu popup="popup" [model]="items"&gt;&lt;/p-menu&gt;
        &lt;button type="button" pButton icon="fa fa-list" label="Show" (click)="menu.toggle($event)"&gt;&lt;/button&gt;
    &lt;/ng-template&gt;
  &lt;/p-column&gt;
  </code></pre>
  
  <p>To get "item" and the row that I'm clicking and other kind of  data.</p>
  
  <p>Using a buttom I can pass item and other data through onClick, but for this I need to create one column for each buttom. And to solve that I want to use Menu with MenuItem from primeng.</p>
  
  <p>The problem is that I can't find any examples passing parameters through a command in MenuItem and I'm not find a way to do it.</p>
  
  <p>How can I accomplish that using MenuItem with DataTable? </p>
  
  <p>If that is not possible, how can I accomplish the same results?</p>