[Data Grid Web] [Data Grid Web] Configuration Save button Success Message for multiple grid in a page
Forge component by OutSystems R&D
Application Type
Traditional Web

Hi,

Hi,

I am using Navigation Tab component and in each tab content I have added the advanced grid.

I have added the ConfigurationSaveButton and ConfigurationResetButton for each data grid. Added the corresponding success and failure messages.

When I click on save config button the success message is coming 3 times because I have 3 tabs and each tab have it's own grid. Also, if I save the settings for each tabs grid and go in one tab and click on reset setting for that tabs grid all the 3 grid's setting gets reset.

I have attached a sample oml file for this scenario.

Could you please suggest the issue resolution and why this is caused.

Thanks,

Unnati.

SaveGridConfigv2.oml

Solution

Hello @Dhanashri Jaiswal ,

Sorry for taking so long to answer.

We were able to track the issue and it has been inserted in the upgrade from version 2.14.1 to version 2.15.0.

We already have the fix implemented, but it will only be available in the next DataGrid component release.

Meanwhile, the suggested workaround is to override the GridOS.ComponentUtils.saveConfig method.

To do this, you can use the Scripts/JS block that is in the DataGridExample module with the correct code.

In order to do this just once and not in every page that has a DataGrid component, you can add this script in the Page Layout web block.

 

In attachment, there is an OML file with a sample implementation of the override.

As you can see in the next image, the GridOS.ComponentUtils.saveConfig method has been overwritten with the correct JS code:

Please let us know if this works for you.

Best regards,

Bruno Martinho

DataGridSaveConfig.oml

mvp_badge
MVP

Hi Dhanashri,

The attached oml is created by me on the below post :

https://www.outsystems.com/forums/discussion/69193/data-grid-web-configuration-save-button-success-message-for-multiple-grid-in-a/

and it's working fine on all the 3 tabs.

I am not able to reproduce the issue.

Regards,

Manish Jawla

Hi Manish,

Correct this is the same oml which you have shared I just added the reset config button part in it.

And for me the issue still persists for the same oml code also. And can you please confirm on the reset config part issue also, is it same for you - all the three grids setting gets reset when we click on reset button for any on the grid?

Hi Manish,

I have the exact same code/application which you have provided on my environment and it is not working for me. Below is the link for accessing the application 

https://dhanashri-jaiswal.outsystemscloud.com/SaveGridConfig/SaveGrid.aspx?_ts=637515263311558526

Could you please check this and suggest me solution for it?

Hi Dhanarshri,

In order to fix this issue instead of adding the Datagrid reset button, you need to create your own custom button and add run javascript in the screen action and call the Datagrid function explicitly.

This will fix the issue, you can check the working example in the below url:-

https://dnyanarth-lonkar.outsystemscloud.com/DataGrid_Save_Reset/SaveGrid.aspx?_ts=637514365233236781


Also, please find the attached oml.

Thanks,
Dnyanarth Lonkar

DataGridSaveResetworkingexample.oml

Hi dnyanarth,

I have tried the solution which you have provided and checked the application by the url provided by you :

https://dnyanarth-lonkar.outsystemscloud.com/DataGrid_Save_Reset/SaveGrid.aspx?_ts=637514365233236781 

When I access the same code for your link/application the save config doesn't give me the success message 3 times it works perfectly. But when I run the exact same code/application  in my environment I get the save settings success message 3 times. Below is the access link to my application

https://dhanashri-jaiswal.outsystemscloud.com/DataGrid_Save_Reset/SaveGrid.aspx?_ts=637515262640847065

Could you please check it and suggest me any solution why only I am getting it with the exact same code?

Hi Dhanashri,

The URL that you have shared https://dhanashri-jaiswal.outsystemscloud.com/DataGrid_Save_Reset/SaveGrid.aspx?_ts=637515262640847065

is working fine at my end and it's showing feedback message only once. I think it's a browser specific issue,
this is the browser detail, which I used for testing the below URL, also please try to clear your cache.

 

Hi,

I have cleared the cache and also the version of my browser is same as yours but I am still facing the same issue.


Hi,

I have observed one change in the js code for GridFramework.js file in your and my environment. Below are the screen shots of it :

your environments code :

my environments code :

here you can see the if and else logic is different for me if I specify gridid to the savecongif block I guess it will run for all the grids present in the screen but for yours always the else part will get executed if you specify any gridid to the saveconfig block.

I am not sure why this js file is different for you and me can you please suggest solution for the same?

Upgrading the Grid version to 2.17.0  will fix your problem.

Is the OML that I provided resolved your reset button issue?, if yes please marked it as solution.

Thanks & Regards,
Dnyanarth

Hi All,

We tried replacing the JS code that @Dhanashri Jaiswal  has observed in the latest version and it worked to resolve the issue.

In the current version code if we provide the grid id it was saving the configuration for all the grids present in the DOM and if the grid is not provided then it executes for first grid. 

This needs to be addressed in the next update of the forge component.

Thanks,

Unnati K

Hello @Unnati Khanorkar ,

Thank you for pointing this out.

We'll check this behavior and give you feedback about this.

Thanks,

Bruno Martinho

Hello @Bruno Martinho ,

Just want to check that do we have any update for this behavior?

We are using data grid excessively in our current project and it would be really helpful if we have any solution for this behavior as we really don't want to customize the component for such small requirement.

Thanks 

Dhanashri Jaiswal

Solution

Hello @Dhanashri Jaiswal ,

Sorry for taking so long to answer.

We were able to track the issue and it has been inserted in the upgrade from version 2.14.1 to version 2.15.0.

We already have the fix implemented, but it will only be available in the next DataGrid component release.

Meanwhile, the suggested workaround is to override the GridOS.ComponentUtils.saveConfig method.

To do this, you can use the Scripts/JS block that is in the DataGridExample module with the correct code.

In order to do this just once and not in every page that has a DataGrid component, you can add this script in the Page Layout web block.

 

In attachment, there is an OML file with a sample implementation of the override.

As you can see in the next image, the GridOS.ComponentUtils.saveConfig method has been overwritten with the correct JS code:

Please let us know if this works for you.

Best regards,

Bruno Martinho

DataGridSaveConfig.oml

Hi @Bruno Martinho ,

Thank you for the workaround. I tried it and it is working as expected.

Really appreciate the help.

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