[]
        
(Showing Draft Content)

Customize Sidebar

DsDataViewer allows you to modify, show, and hide the sidebar using sidebarLayout property and showSidebar method. sidebarLayout property enables customizing the sidebar layout, whereas showSidebar method shows or hides the sidebar.

Modify Sidebar Layout

  • Refer to the following example code to modify the sidebar layout to exclude the Search Panel:

    // Initialize DsDataViewer.
    var viewer = new DsDataViewer(selector, {});
    
    // Display an empty sidebar without the Search Panel.
    viewer.sidebarLayout = [''];

    DsDataViewer applies an empty sidebarLayout entry to display a sidebar without the Search Panel control.


  • Refer to the following example code to modify the sidebar layout to include the Search Panel:

    // Initialize DsDataViewer.
    var viewer = new DsDataViewer(selector, {});
    
    // Display Search Panel.
    viewer.sidebarLayout = ['SearchPanel'];

    DsDataViewer applies the SearchPanel entry in sidebarLayout to display the Search control in the sidebar.


  • Refer to the following example code to display the default sidebar layout:

    // Initialize DsDataViewer.
    var viewer = new DsDataViewer(selector, {});
    
    // Display default sidebar layout.
    viewer.sidebarLayout = [];

    DsDataViewer applies an empty sidebarLayout array to restore the default sidebar with its standard Search control.

Show/Hide Sidebar

  • Refer to the following example code to show the sidebar:

    // Initialize DsDataViewer.
    var viewer = new DsDataViewer(selector, {});
    
    // Show sidebar.
    viewer.showSidebar(true);

    DsDataViewer calls showSidebar with true to display the navigation sidebar beside the workbook data area.


  • Refer to the following example code to hide the sidebar:

    // Initialize DsDataViewer.
    var viewer = new DsDataViewer(selector, {});
    
    // Hide sidebar.
    viewer.showSidebar(false);

    DsDataViewer calls showSidebar with false to hide the sidebar and expand the visible workbook data area.