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

[DataGrid] - Add Loading and LoadingContent parameters #1368

Merged
merged 4 commits into from
Jan 22, 2024

Conversation

vnbaaij
Copy link
Collaborator

@vnbaaij vnbaaij commented Jan 22, 2024

This PR adds Loading (bool, default = false) and LoadingContent (RenderFragment?) parameters to the FluentDataGrid.

By default, when Loading is set to true, the loading content will be a progress ring with the text 'Loading...' shown besides it. You can replace that with your own content through this parameter.

To change the state of the Loading parameter at a later stage, use the SetLoadingState(bool loading) method on the FluentDataGrid. To be able to call this method from your code, you need to add a @ref to your grid

The loading content is rendered in a FluentDataGridRow with one FluentDataGridCell inside of it. The row height will be set to 100%. If no height is set for the grid this will be a normal row height. It a height is set for the grid, the row will take up all remaining height. In the example below, no height was specified for the grid.

datagrid-1317

In this example te height of the grid is set to 100% of its container. Loading content takes full height (minus header height)
image

With this PR we are also chaging the way the EmptyContent is rendered to use the same approach (FluentDataGridRow with one FluentDataGridCell inside and following same height settings). As this is a change from earlier versions, please check your results!

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-pebble-0dc79cb03-1368.westeurope.3.azurestaticapps.net

@vnbaaij vnbaaij linked an issue Jan 22, 2024 that may be closed by this pull request
@vnbaaij vnbaaij self-assigned this Jan 22, 2024
@vnbaaij vnbaaij added this to the V4.4.0 milestone Jan 22, 2024
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-pebble-0dc79cb03-1368.westeurope.3.azurestaticapps.net

@vnbaaij vnbaaij added the feature A new feature label Jan 22, 2024
@vnbaaij vnbaaij enabled auto-merge (squash) January 22, 2024 11:13
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-pebble-0dc79cb03-1368.westeurope.3.azurestaticapps.net

1 similar comment
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-pebble-0dc79cb03-1368.westeurope.3.azurestaticapps.net

@vnbaaij vnbaaij merged commit 3dddf15 into dev Jan 22, 2024
4 checks passed
@vnbaaij vnbaaij deleted the vnbaaij/data-grid-loading-content branch January 22, 2024 12:36
vnbaaij added a commit that referenced this pull request Jan 23, 2024
* [DataGrid] - Add Loading and LoadingContent parameters

* Additional height work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add loading indicator to DataGrid
2 participants