Skip to content
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

Feature: Flex Grid VScroll #1

Open
john-theo opened this issue Sep 27, 2021 · 3 comments
Open

Feature: Flex Grid VScroll #1

john-theo opened this issue Sep 27, 2021 · 3 comments

Comments

@john-theo
Copy link

Amazing work! I have been looking for a js vscroll solution, without any frameworks. And I ended up here. I tried the demo, and am largely satisfied with the current result. But when it comes to "multi-column" vscroll, most vscroll project just put it in the wip or gotcha section. But I think in my case, padding height of a flex css grid is calculatable.

I have a bunch of square containers with their parent has these css styles:

display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: flex-start;
gap: 20px;

How should I use this project? Do you have any suggestions for me?

@dhilt
Copy link
Owner

dhilt commented Sep 27, 2021

@john-theo I'm very glad that you have found this project. Of course, multi-column issue has been raised several times in related ngx-ui-scroll project, and this is what we have reached at this moment:

Both cases provide an additional "grouping" layer between the initial flat dataset and the Scroller, which also wants flat list. Scroller's item becomes a group of initial items. The logic of this layer can be taken from app.component.ts. Templating should be tweaked. You'll need to move inner grouping template (*ngFor) from the html page code to the item template factory, like

  const template = (group: Item[]) =>
    `<div class="group">` +
      group.map(item =>
        `<div class="item"><span>${item.data.id}</span>) ${item.data.text}</div>`
      ) +
    `</div>`

If you can start make vscroll-native grouping demo (for example by forking the first stackblitz sample), I will help you to finish it and make it work.

@john-theo
Copy link
Author

Thank you so much! I am working on a project that needs virtual scroll functionality, I will try to figure something out based on your example. Any luck on it, I would create a CodePen or something and keep you posted here! Thanks again for your suggestion!

@dhilt
Copy link
Owner

dhilt commented Oct 4, 2021

@john-theo I dream to create a list of vscroll-native demos on stackblitz, codepen or whatever, and a grouping demo would be very important. I can't find time to do this by myself right now, but I gladly would join if you take any steps in this direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants