1
How do you set the default view mode for toolbar items etc.?
Question asked by Al Del Degan - June 13 at 12:44 PM
Answered
When I initialize the .NET MVC page that displays the Document Ultimate control I want to have some defaults set for how it will look for the user.   For example, I would like to hide the side panel and set the page layout mode to continuous and use "fit width".  So far, I have not been able to find any initialization defaults in the knowledge base or community forum.  It seems like this should be extremely simple but I don't know how to do it.

1 Reply

Reply to Thread
1
Cem Alacayir Replied
June 16 at 11:41 AM
Employee Post
There are some direct properties for some,  we plan to add more:
 
SidePaneVisible
Gets or sets a value that specifies whether the left side pane is visible. The default is true.
 
ToolbarVisible
Gets or sets a value that specifies whether the top toolbar is visible. The default is true.
 
Others can be set like this:
 
<GleamTech:DocumentViewer ID="documentViewer" runat="server" 
        Width="800" 
        Height="600" 
        Resizable="True" 
        ClientLoad="documentViewerLoad" />
        
        
<script type="text/javascript">
    function documentViewerLoad(sender, e) { 
        var documentViewer = sender; //sender parameter will be the DocumentViewer instance

        documentViewer.setZoomLevel(1); // Set zoom to 100%
    }
</script>
 
Alternative methods that adjust view:
 
documentViewer.fitPage(); // Adjust page so that both width and height fits the view

documentViewer.fitWidth(); // Default behavior
Layout modes:
 
documentViewer.setLayoutMode("Continuous"); // Default behavior

documentViewer.setLayoutMode("Facing");

documentViewer.setLayoutMode("FacingContinuous");

documentViewer.setLayoutMode("FacingCover");

documentViewer.setLayoutMode("FacingCoverContinuous");

documentViewer.setLayoutMode("Single");
 
 

Reply to Thread