diff --git a/articles/components/dashboard/index.adoc b/articles/components/dashboard/index.adoc index b79dfc63f5..840652177a 100644 --- a/articles/components/dashboard/index.adoc +++ b/articles/components/dashboard/index.adoc @@ -428,7 +428,18 @@ endif::[] === Persisting and Loading Widgets -// TODO +Dynamic dashboards, with their user-editable capabilities, often require the ability to persist and load customized widget configurations to and from storage, such as a database. + +The most straightforward way to persist widget configurations is by defining a custom widget/item type. This type can include additional custom metadata relevant to the widget content, in addition to the built-in widget/item properties. + +Once you've defined your custom type, you can establish a mapping between your data model and the widget configuration. This involves: + +- Loading: When loading the persisted configuration, map the data from your storage to individual widget/item instances of your custom type. Each record corresponds to a single widget on the dashboard. +- Saving: When saving the user's customized dashboard layout, map the current configuration (e.g., column span, row span, type, custom metadata) of your dashboard's widgets back to your data model format. + +This approach allows for flexible persistence of dashboard configurations, enabling users to save and load their customized layouts across sessions. + +For a simple example of how to implement this persistence approach, refer to the <<#dynamic-dashboards>> section above. While the example doesn’t explicitly demonstrate data persistence, it illustrates the concept of defining a custom type for the dashboard widgets. The specific implementation details depend on your chosen storage mechanism and data model. == Dashboard Sections