Resource Base
Table of contents

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 method getUiConfig().
      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);
    

Update UI dynamically

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version
    Change +
    © 2003–2024 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support