Skip to content

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!

@github-actions
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 requested a review from dvoituron January 22, 2024 11:12
@vnbaaij vnbaaij added this to the V4.4.0 milestone Jan 22, 2024
@github-actions
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
@github-actions
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
@github-actions
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
@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

3 participants