Your requirement should be related to the mouse? I ask because there is a built-in built-in click event that you can use, and the mouse is not very convenient for mobile devices (if that bothers you).
If you have a mouse add-in, I donβt think there is something built-in, but you can download the source code and then add only a data component to your project (maybe rename it and remember to change your import to your app. module.ts for the datatable component), edit the datatable.ts file (as shown here: https://github.com/primefaces/primeng/blob/master/src/app/components/datatable/datatable.ts )
and capture events (mouseenter)="hover=true" (mouseleave)="hover=false" in the template and place your own functions there to do what you want, for example:
(mouseenter)="showRowData($event)" (mouseleave)="hideRowData($event)"
something like that. Regarding the actual display of the data, you will need to decide how you want it to look, and then implement it accordingly [scope outside of this].
I don't know if this is the best, but I think it will work.
source share