129
Views
4
Comments
Solved
[OutSystems Data Grid] Datagrid does not respond to schema change
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

I got a simple question related to Outsystems Datagrid

Q: If the data grid has only one event i.e. Initialize, there must be a way to re-initialize. What could that be? Tried binding it to a variable inside of a block (with a input variable for data source) hoping it to reinitialize as the input variable changes but that too failed :(

Scenario: All the community examples talk about data updates to the grid row/column/cell etc. where the shape of the backing data structure hasn't changed

I'm dealing with a scenario where the backing data structure itself is dynamic and hence I cannot have manual column definitions and have to rely on the auto columns. However, the grid doesnt refresh the underlying data structure changes till I do a hard refresh of the page, post which it does

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi,

In your use case, with the DataSource schema change, you will have to invoke the Grid refresh method as mentioned below.

Code Snippet:

GridAPI.GridManager.GetGridById($parameters.GridWidgetId).provider._items.refresh();

Demo Screen: DG_RefreshDataSource

Refer to the attached oml.

I hope this helps you!


Kind regards,

Benjith Sam

DG_RefreshDataSource.oml
UserImage.jpg
ARS

Appreciate your help @Benjith Sam worked like a gem!

2021-03-18 21-03-15
Benjith Sam
 
MVP

You're welcome.

Glad to help :)


Kind regards,

Benjith Sam

UserImage.jpg
ARS

@Daniël Kuhlmann any comments much appreciated :)

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi,

In your use case, with the DataSource schema change, you will have to invoke the Grid refresh method as mentioned below.

Code Snippet:

GridAPI.GridManager.GetGridById($parameters.GridWidgetId).provider._items.refresh();

Demo Screen: DG_RefreshDataSource

Refer to the attached oml.

I hope this helps you!


Kind regards,

Benjith Sam

DG_RefreshDataSource.oml
UserImage.jpg
ARS

Appreciate your help @Benjith Sam worked like a gem!

2021-03-18 21-03-15
Benjith Sam
 
MVP

You're welcome.

Glad to help :)


Kind regards,

Benjith Sam

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.