How can i add event listener in table primereact? #1916
Unanswered
luongminh2111
asked this question in
PrimeReact
Replies: 1 comment
-
if you are using dataTable then you do not need an event listener. https://primereact.org/datatable/#lazy_virtualscroll I do not believe that ref currently works with PrimeReact but I may be wrong. If that is correct though you can try using Document.getElementById to get the element instead of using Ref |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
in table primereact, i want to add event listerner "scroll" to setup call api load more data when user scroll table body to bottom:
const tableElement = tableRef.current;
const tableBodyElement = tableElement?.getElement()?.getElementsByTagName('tbody')?.[0];
........
tableBodyElement ?.addEventListener("scroll", handleScroll);
but event listener can't add. Do anyone have solution for this case, please help me.
Beta Was this translation helpful? Give feedback.
All reactions