-
Notifications
You must be signed in to change notification settings - Fork 373
Using vue-infinite-loading
with tables
#43
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
Comments
Thanks for appreciation! I think this problem can be solve if the And there has another way to fix it with |
Yeah, I was able to make it work with a slot placed after line 34 in Table.vue file. It does seem like the simplest and most intuitive solution. Thanks! |
I had requested this extra slot in ElementUI, and they've added it, but not next to the table itself and rather inside it (as there were some other uses for it there). I thought it wouldn't matter, as However, this component is unable to detect that enough rows have been loaded and continues calling the Re-opening as I think this new issue can be resolved in this component than ElementUI. Thoughts? |
vue-infinite-loading
with tables
I noticed that |
Yeah. Do you know what is the best way to debug pluggable components like this? |
I found some informations, |
You can debug it in your local computer with source code and |
What do you mean by "local |
You're welcome! Local |
Oh, very interesting. Never thought about using local server that way, haha. |
@PeachScript |
Fix #43: Improve the way to calculate distance
@Syn-zeta I have merged your PR, but it cannot work properly when the scroll parent is |
This new version doesn't seem to work right in a "normal" table case - it scrolls way too soon. If I use this.$el.offsetTop when calculating the distance it seems good, but the new elOffsetTopFromScrollElm isn't right. Thanks! |
@PeachScript Works great, thank you! @ckaczor |
Try this: https://jsfiddle.net/81q6bmLh/2/ Note that it loads well before the bottom of the list. It is especially noticeable as the list gets longer. The 2.1.0 version scrolls down at the bottom as expected. Thanks again, Chris |
@ckaczor The issue is clear with 2.1.0 (continues loading): https://jsfiddle.net/81q6bmLh/7/ I'm sorry, I still do not understand what you meant by
|
Updates to match my code better: 2.1.1 - https://jsfiddle.net/81q6bmLh/8/ The 2.1.1 version loads more data way before the scrollbar reaches the configured distance. By a few hundred items it is scrolling when the scrollbar is halfway down. The 2.1.0 version always loads when the scrollbar is within the configured distance. No matter how many items it doesn't load until the scrollbar reaches the bottom. |
Yes, both versions seem to have an issue. 2.1.0 was faulty when placed inside a |
Edit: Woops, didn't reload the page to see that you had already posted a possible fix, @PeachScript. I've commented on the differences between your fix and my patch (below) here.Possibly fixed:
I will test it more tomorrow in other scenarios, and will post my findings. Can you guys also try to see if there are any issues in the build used in above two fiddles? |
@Syn-zeta I tested your patch, it's nice! Could you make a PR to fix it after test in tomorrow? |
In order not to affect other users, I have deprecated |
@Syn-zeta Both of those test cases look good to me. Tried it with my real code and it looks good there too. Thanks! |
So I've tested the patched version with all the examples on the component home page and different attribute values, and I haven't found any issues. This is where I tried out the demos. I'll create a PR with the patch. Thanks guys. |
@PeachScript I think I tested what you meant in the fiddle that I posted in my previous post above (the Hacker rank demo), unless I misunderstood you? |
@Syn-zeta after testing, I found my worry is unnecessary, thanks! |
|
What's the solution with el-table now? I tried but failed. I am afraid have I missed anything ? I found the code that However, if I gave a Here's my info
Looking forward to your help. |
I cannot publish on jsfiddle. My code would like below
|
First of all, thank you for this awesome and easy-to-use component.
I'm trying to use infinite-loading with ElementUI's fixed-header table. It works fine with a regular table, but as I'm aware, the infinite-loading component needs to be a child of a scrollable element to work properly, which would not be the case if placed next to ElementUI's table component with a fixed header as it separates out the table-body wrapper.
Demo: https://jsfiddle.net/frya0fLz/
One of the solutions I thought of would be to have a slot inside the table-body wrapper, but had trouble trying it out.
Would it be possible to have infinite-loading component hook into the generated element of ElementUI's table?
The text was updated successfully, but these errors were encountered: