Trying to find a way how to properly update the configuration of a widget outside it's configuration component

I am currently extending a Widget (Angular) for a customer. The widget is a basic diagram widget with a legend, and I want to store the state of the legend entry as soon as someone clicks on the desired entry. I’d like to store it in the “configuration Object” of the Widget

I have not been able to find any service or method that could update the config object from outside the configuration widget.

There is, of course, the possibility to implement a workaround by storing a “custom object” in the “Managed Object” of the dashboard and providing a custom-generated ID to the widget to identify the configuration afterward. However, before I try that, I would like to know if there is another way to solve this.

Another side effect of this workaround would be that I would have to somehow track if the user deletes a widget and clean up my “custom configuration” afterward.

Does anyone know if there are built-in solutions I could use for this?

Hi @dborowski,

Cumulocity’s dashboarding functionality is not really designed this way. Changes to the configuration of a widget are meant to be done in the widgets configuration component.

If changes would be persisted already in the dashboard view of the widget, it would be not really obvious for a user that he is making a change that will also affect all other users.

Have you considered just storing the changes done by the user in your local storage instead of Cumulocity’s inventory? So the change would only affect the current user on this specific machine instead of all users. Or is this persistance for all users a requirement?

Regards,
Tristan

Hi @Tristan_Bastian,

Good point. We discussed this matter again, and the persistence for all users is not required. So your suggestion seems to be the perfect solution for that case! :slight_smile:

Thanks for the quick response!

Greetings,
Dominik