dataTable onScroll not working #110
-
https://codesandbox.io/s/primereact-demo-forked-z9sk2r?file=/src/App.js This does not give any console output, when scrolling:
|
Beta Was this translation helpful? Give feedback.
Answered by
FlipWarthog
Sep 26, 2023
Replies: 1 comment
-
DataTable itself does not have an onScroll event, but the underlying VirtualScroller does. So you could do something like: <DataTable
value={products}
scrollable
scrollHeight="100px"
virtualScrollerOptions={{
itemSize: 50,
onScroll: (e) => {
console.log("e", e);
}
}}
tableStyle={{ minWidth: "50rem" }}
>
<Column field="code" header="Code"></Column>
<Column field="name" header="Name"></Column>
<Column field="category" header="Category"></Column>
<Column field="quantity" header="Quantity"></Column>
</DataTable> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mattqs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DataTable itself does not have an onScroll event, but the underlying VirtualScroller does. So you could do something like: