Update UI dynamically after creating the viewer
Sometimes, dynamically changing the layout is required, such as hiding specified elements or modifying the available status of elements under certain conditions. getUiConfig()
and updateUiConfig()
can help to achieve these requirements.
Use case
Hide the header dynamically.
- Step one: Get current
UiConfig
by using methodgetUiConfig()
.const editViewer = new Dynamsoft.DDV.EditViewer({ container: "viewer", }); const uiConfig = editViewer.getUiConfig();
- Step two: Remove the header from current
UiConfig
.uiConfig.children.splice(0,1);
- Step three: Update the revised UiConfig by using method
updateUiConfig()
.editViewer.updateUiConfig(uiConfig);