-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to scroll to a specific row, not y position? #94
Comments
anyone? |
the height for each row will dependents on the 1st of row if it hasn't been rendered, If every tr has been rendered (scroll the table from top to bottom... ), then calling scrollTo will accurately scroll to the specified position. |
@wubostc Sorry, didn't get it... could you elaborate (or post some example?) How would I do if I want to scroll, for example, to row 625? |
https://github.com/wubostc/virtualized-table-for-antd/blob/master/test/reload.tsx like following...
|
@wubostc but those examples still use y position, not the row index, or am I missing something? ex: if I have 5 rows row 0: height: 50 the average row height is 60, but if try to locate the y position of the row based on an average I get an inaccurate position I want a way to say something like: |
that is the correct scrolling behavior , a correct value ...
0 : 50 -> 50 |
and these 300-305 to calculate the top value. you can see it, and you will know ... |
VT is rendered based on simulated events. currently, it cannot be rendered based on rowIndex... to achieve what you said requires some changes that are not too difficult. . . |
Hi! Any news on this? The API proposed by @dcfranca looks interesting, i have a similiar usecase on my table. Thanks! |
@eduardobalbo you can use and then the first item you said needs to be highlighted, you can reference both https://ant.design/components/table/#components-table-demo-edit-cell and https://github.com/wubostc/virtualized-table-for-antd/blob/master/test/CustomRows%20Hooks.jsx |
Thank you @wubostc! My ANTD table is set as follows:
Styles as follows:
And my VT declaration is as follows:
There are no errors on the console even with debug set to true. It's kinda weird since there are some times that i have almost 2000 rows, and sometimes i have like 10 or so, but with the blanks still there as if i still had 2000 rows. It dosnt allways happens, but it's quite often. Any idea why? |
@eduardobalbo You can see the prop "CLICK~__DIAGNOSIS__" in the debug info (click it to expand), then click it, everything is okay if that shows "normal". |
Hello @wubostc ! When i load data on "table A", it works fine, all the rows are rendered and the scroll is also rendered when the table gets to it's maxHeight, i also can scroll the whole table normally. When i load data on "table B", it also works fine, but, if "table B" has a maxHeight smaller than "table A", it sets table A height to just one row, or sometimes to the same height as the maxHeight on the smaller table ("B"). Both tables are using different VT declarations with distinct 'id' properties. It also happens if we invert the logic and make "table B" maxHeight bigger than "table A", thus making "table B" have only one row when "table A" content is smaller than "table B" maxHeight. Right now table A is set as follows:
And table B as follows:
I hope it doesnt sound that confusing, but this is the only issue i'm having now. Thanks! |
You'd better reproduce your issue in codesandbox😂, i need the debugging info includes both tables I guess it may not trigger rerendering…… |
Guys, could you, please, open a new issue about that? This is totally unrelated with the original issue |
Will do! |
@dcfranca I have added func |
@wubostc Awesome! Thanks! is it already on its latest version? |
Thanks! I'll check it out! |
The height of my rows vary, so it is hard to be accurate while trying to scroll to it
Is there a way to specify the row to scroll to? Or a way to figure out the y value on that position so I can pass the correct value to scrollTo?
At the moment I'm doing something like:
ref.current.scrollTo(index * avgRowSize);
But it is highly inaccurate, and more often than not it leads to a totally different place
The text was updated successfully, but these errors were encountered: