Data Grid 2 Personalisation gives Render issue after changing the columns

3
Within some of my projects I'm using Data Grid 2 with the personalization options configured.  When we change a column in the modeler the personalization breaks and we get a  'Could not render widget 'MyFirstModule.Product_Overview.dataGridProduct'' error. In the console: Invalid columns state: invalid columns order Error: Invalid columns state: invalid columns order   The issue is that the personalization is stored as a JSON and that JSON is missing the information from the added/removed column. Right now every time we change something in the Data Grid 2 we execute a hotfix that sets the attribute empty for every user.  With as result that users report that their personalization settings are gone.   Is there a pretty way to fix this? Should Mendix fix this themselves?   I'm using Mendix 10.5.0 and Data Widgets version 2.11.0. 
asked
3 answers
1

Hi Chendo

 

We have experienced a similar issue. Instead of setting everything to empty, we wrote some logic in the after startup action that loops over all the accounts and their column configurations. Within the loop, we change the JSON to capture the changes that we made. For example when adding a column, we agreed that it would always appear at the end of the grid, so it is as simple to append the new JSON object at the end of the string. 

For changing column numbers and removing columns, it gets a bit more complex in your logic (changing all column numbers +1 or -1), however if your logic works, it should just get the job done. 

 

It is a bit cumbersome, I admit, but it works if you add the logic in the right way.

I hope this helps.

answered
1

Very unstable, this should be inbuilt in the widget, lots of custom logic for a simple feature.

answered
1

Just noticed that Mendix released a new version of the Data Widgets (v2.12.1) where the issue is 'fixed'. (Since v.12.0)

 

The fix Mendix built in is that it cleans the configuration and that it's set to empty again when there is a change on the columns...

answered