Skip to content

Implementing a trigger event for hierarchical datagrid expand #2241

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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Mil4n0r
Copy link
Collaborator

@Mil4n0r Mil4n0r commented Jun 11, 2025

Checklist

  • Build process is done without errors. All tests pass in the /lib directory.
  • Self-reviewed the code before submitting.
  • Meets accessibility standards.
  • Added/updated documentation to /website as needed.
  • Added/updated tests as needed.

Purpose
The idea of the change is being able to handle highly nested data in a more appropiate way. With the previous API we were forcing the users to load the whole dataset inside the rows item from the DxcDatagrid. Which is not feasible most of the time due to big performance impact.

Description
In order to achieve that purpose, a new prop has been added to the component, loadChildren?: (expandChildren: HierarchyGridRow) => HierarchyGridRow[] | Promise<HierarchyGridRow[]>;. As its name says, it is an additional way of setting the children for a hierarchical data, this data can come from any type of source and is specially useful for lazy loading purposes (until you click on the expand button, the children data for that node is not processed).

Additional context
There are still some edge cases which have to be reviewed as well as including additional documentation, testing and stories for the component.

@Mil4n0r Mil4n0r marked this pull request as ready for review June 12, 2025 08:22
@Mil4n0r
Copy link
Collaborator Author

Mil4n0r commented Jun 12, 2025

Should we add a mechanism to display a spinner while the data is being loaded when setting the loadChildren function?

@Jialecl
Copy link
Collaborator

Jialecl commented Jun 25, 2025

Should we add a mechanism to display a spinner while the data is being loaded when setting the loadChildren function?

They are able to use the Spinner component easily without any mechanism from the datagrid

Copy link
Collaborator

@Jialecl Jialecl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to discuss about this approach because I find issues with delays in case the children are not returned instantly.

@Jialecl Jialecl self-assigned this Jul 7, 2025
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

Successfully merging this pull request may close these issues.

2 participants