Datagrid2 - personalization configuration breaking after adding a new column

1
I have recently implemented a Datagrid 2. I've wrapped it in a Dataview that can capture the personalisation configuration for each user. If there is a personalisation for a user/table retrieve if there is one, else create one (onChange save)   This all works as expected but ... when I add a new column to the Datagrid2 I get an "Invalid columns state: invalid columns order Error: Invalid columns state: invalid columns order" I gather that this is because the column doesn't exist in the saved string (unlimited) as it has 32 columns but the grid now has 33?   So does anyone know how to overcome this?   Invalid columns state: invalid columns order Error: Invalid columns state: invalid columns order at http://localhost:8081/widgets/com/mendix/widget/web/datagrid/Datagrid.js?638373733345689572:6:42637 at http://localhost:8081/widgets/com/mendix/widget/web/datagrid/Datagrid.js?638373733345689572:6:42695 at ct (http://localhost:8081/widgets/com/mendix/widget/web/datagrid/Datagrid.js?638373733345689572:6:43091) at st (http://localhost:8081/widgets/com/mendix/widget/web/datagrid/Datagrid.js?638373733345689572:6:42425) at Object.Ra [as useReducer] (http://localhost:8081/mxclientsystem/mxui/mxui.js?638373733345689572:34:64054) at t.useReducer (http://localhost:8081/mxclientsystem/mxui/mxui.js?638373733345689572:54:6098) at it (http://localhost:8081/widgets/com/mendix/widget/web/datagrid/Datagrid.js?638373733345689572:6:41923) at http://localhost:8081/widgets/com/mendix/widget/web/datagrid/Datagrid.js?638373733345689572:6:43689 at Ca (http://localhost:8081/mxclientsystem/mxui/mxui.js?638373733345689572:34:62778) at js (http://localhost:8081/mxclientsystem/mxui/mxui.js?638373733345689572:34:74399)  
asked
3 answers
2

Hi there

 

I answered a similar issue in this forum post: https://forum.mendix.com/link/space/widgets/questions/130339

The methodology is a bit cumbersome, but if you do not want to lose the current configuration of the users (so not just setting the attribute to empty), it is the only way I am aware of as of now.

 

Hope this helps!

answered
1

I can confirm this issue:

Seemingly the configuration is stored using the Caption of each column.

When you change the Caption, or translate the Caption, or add a column as Colin mentioned, you get this error when the Datagrid2 is rendered: "Invalid columns state: invalid columns order Error: Invalid columns state: invalid columns order"

As a workaround, we created an admin function to delete the configurations, to be executed after a change in the column Captions.

Would be more elegant if the Datagrid2 would detect this change or catch the error and reset it automatically.

answered
0

Hi Colin,

 

Wow, great question. You can delete the string that is configured here: https://docs.mendix.com/appstore/modules/data-grid-2/#9-configuration after each time you update the number of attributes. 

 

Another option would be to change the string.

 

Go Make It

answered