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

Provides the possibility of paginating data for the first level of the TreeView #5112

Open
matuzalemsteles opened this issue Sep 28, 2022 · 2 comments
Labels
comp: clay-components Issues related to Clay components. (e.g ClayCard, ClayLabel...) type: enhancement Issues that are open to bring improvements or refinement of code

Comments

@matuzalemsteles
Copy link
Member

This is a follow-up issue of the implementation in PR #5103, as we don't have a root item of a tree, we couldn't make an implementation that allows loading paginated data to the first level because it's an Array, this makes things more complicated here because the rendering of the elements inside the TreeView is an Item scope.

The ideal solution is for a tree to always have a root item this will work fine, but this should not reflect the look, as the Lexicon in TreeView should not have a root item. So we need to ignore the visual state of a root item and just use it internally, DXP teams don't need to worry about that and also we shouldn't change your Array structure to a root item added by TreeView, so we should do this as a virtual root item that allows you to make the paginated data engines work properly.

This can make things more complex internally because we will need to hide this, and also the TreeView structure on how it shares information between items is using element nesting, so we need to adjust that.

The goal of the issue is to allow the paginated data to be done transparently as it is done for the other levels and not need complex implementation done by the developers.

@matuzalemsteles matuzalemsteles added type: enhancement Issues that are open to bring improvements or refinement of code comp: clay-components Issues related to Clay components. (e.g ClayCard, ClayLabel...) labels Sep 28, 2022
@matuzalemsteles matuzalemsteles self-assigned this Oct 20, 2022
@matuzalemsteles
Copy link
Member Author

I'm evaluating if it makes sense internally to add a root item so that the TreeView can be able to render extra elements on the first level and have the asynchronous load data paginated, the problem is that this will create a lot of edge cases that can cause a lot of bugs on different fronts, at this point I'm seeing how much this can impact the TreeView codebase and maybe it's not worth the effort on that. I'm looking at other strategies to achieve the issue goal.

@matuzalemsteles
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: clay-components Issues related to Clay components. (e.g ClayCard, ClayLabel...) type: enhancement Issues that are open to bring improvements or refinement of code
Projects
None yet
Development

No branches or pull requests

1 participant