[Data Grid] Datagrid not populated when toggling visibility of the widget

Forge Component
(41)
Published on 24 Aug (4 weeks ago) by OutSystems R&D
41 votes
Published on 24 Aug (4 weeks ago) by OutSystems R&D

Came across the issue while working on a solution where I use a "SectionExpandable"  to collect the user data and build up the filter. Then collapse the SectionExpanshow and show the datagrid with a Show/Hide toggle mechanism. I can read the summary of the Rest API at the pagination and record count footer. But no data in the grid. Can anyone out there suggest a work around? Anticipated thanks.


Emmanuel Lamy

Jesus Film Project

Emmanuel Lamy wrote:

Came across the issue while working on a solution where I use a "SectionExpandable"  to collect the user data and build up the filter. Then collapse the SectionExpanshow and show the datagrid with a Show/Hide toggle mechanism. I can read the summary of the Rest API at the pagination and record count footer. But no data in the grid. Can anyone out there suggest a work around? Anticipated thanks.


Emmanuel Lamy

Jesus Film Project


The datagrid has a refresh grid component are you using that?    I’ve found that any Ajax refresh of the grid container breaks everything.   So you will want to use their refresh tool instead.


if you have multiple grids and need to Ajax refresh so the proper grid is displayed then it’s tricky.   I stored the filter values in session variables and then when the user clicks “search” I reload the page via JavaScript.    Then the proper grid is displayed on render and the datagrid is also populated.

Josh Herron wrote:

Emmanuel Lamy wrote:

Came across the issue while working on a solution where I use a "SectionExpandable"  to collect the user data and build up the filter. Then collapse the SectionExpanshow and show the datagrid with a Show/Hide toggle mechanism. I can read the summary of the Rest API at the pagination and record count footer. But no data in the grid. Can anyone out there suggest a work around? Anticipated thanks.


Emmanuel Lamy

Jesus Film Project


The datagrid has a refresh grid component are you using that?    I’ve found that any Ajax refresh of the grid container breaks everything.   So you will want to use their refresh tool instead.


if you have multiple grids and need to Ajax refresh so the proper grid is displayed then it’s tricky.   I stored the filter values in session variables and then when the user clicks “search” I reload the page via JavaScript.    Then the proper grid is displayed on render and the datagrid is also populated.

Yep. That is the exact same thing that I have done. Except that I enclosed the DG in a container I use to toggle the "Display" property using a boolean local variable. When I remove the DG out of the container and make it always visible, it's getting populated just fine. So, I concluded that Datagrid might support toggling Show/Hide attributes.


Emmanuel Lamy wrote:

Josh Herron wrote:

Emmanuel Lamy wrote:

Came across the issue while working on a solution where I use a "SectionExpandable"  to collect the user data and build up the filter. Then collapse the SectionExpanshow and show the datagrid with a Show/Hide toggle mechanism. I can read the summary of the Rest API at the pagination and record count footer. But no data in the grid. Can anyone out there suggest a work around? Anticipated thanks.


Emmanuel Lamy

Jesus Film Project


The datagrid has a refresh grid component are you using that?    I’ve found that any Ajax refresh of the grid container breaks everything.   So you will want to use their refresh tool instead.


if you have multiple grids and need to Ajax refresh so the proper grid is displayed then it’s tricky.   I stored the filter values in session variables and then when the user clicks “search” I reload the page via JavaScript.    Then the proper grid is displayed on render and the datagrid is also populated.

Yep. That is the exact same thing that I have done. Except that I enclosed the DG in a container I use to toggle the "Display" property using a boolean local variable. When I remove the DG out of the container and make it always visible, it's getting populated just fine. So, I concluded that Datagrid might support toggling Show/Hide attributes.


The show/hide is triggered by an AJAX refresh though correct?    Which breaks the Datagrid.


you might try setting the Boolean as a session variable and then doing a page reload via JavaScript and see if you get the same behavior.   I don’t have access to my pc right now to test but I believe window.location.reload(); should do it.