Skip to main content

Loading State

This section described loading a dock layout.

onDidLayoutFromJSON
Invoked after a layout is deserialzied using the fromJSON method.
onDidLayoutFromJSON: Event<void>
fromJSON
Create a component from a serialized object.
fromJSON(data: SerializedDockview, options: {
reuseExistingPanels: boolean
}): void

Load A Layout

To load a layout you should a pass a valid object to fromJSON. If you try to load an invalid or corrupted layout the dock will throw an Error and the dock will reset gracefully ready for another attempt with a valid object.

You could load a previously saved layout from local storage for example.

Live Example