context menu function arguments from component input

UI Components for Angular
Post Reply
matt_acctv
Posts: 2
Joined: 19 Aug 2020, 03:13

04 Sep 2020, 02:38

Hi, I'm building a generic table component based on the Prime Table. I'm stuck, however, on trying to pass contextMenu items into the component because the MenuItem's command function uses a local variable and I can't figure out a way to pass that in. If I pass in a MenuItem with a command like

Code: Select all

(e) => console.log(e)
I can see the function is passed the event, but not the row data. As the selected row data must go to a local variable, I can't see how to pass that into the command function. Is it possible? Any help greatly appreciated!

matt_acctv
Posts: 2
Joined: 19 Aug 2020, 03:13

15 Sep 2020, 04:50

Just in case anyone else tries to do this, I fixed it by using an Output which emits the selected table item using (onContextMenuChange). The parent then uses that object in the contextMenu item commands

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests