• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security and Formatting Options
      • Base Actions
      • Application Namespace
      • Clipboard Namespace
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
      • Message Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • System Namespace
      • UI Namespace
        • UI Action Invoker Namespace
        • UI.alert Action
        • UI.closeDialog Action
        • UI.enumerateWebViews Action
        • UI.getDisplayOptions Action
        • UI.getInputData Action
        • UI.getMaxDisplayDimensions Action
        • UI.postWebMessage Action
        • UI.setDisplayOptions Action
        • UI.showDialog Action
        • UI.view Action
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

UI.getDisplayOptions Action

Format
s = CS.UI.getDisplayOptions()
Description
The UI.getDisplayOptions action returns the display options associated with the current web view. These display options may be useful to examine before using UI.setDisplayOptions to size an HTML dialog shown using UI.showDialog.
Display options are returned by web views that show HTML dialogs or display HTML question text.
Return Value
If no web view is showing that uses displays options, the action returns undefined. Otherwise, the action returns an object containing the current values for the display options that have been set, or the default value for the options (when applicable):
PropertyPlatformValue
"width"AllThe desired width, in display units or a percent, of the dialog.
"height"AllThe desired height, in display units or a percent, of the dialog, or the question text (on Windows only).
"resizable"WindowsIf true, the dialog can be resized.
"borderColor"WindowsThe color of the dialog border, which can be specified as a HTML color name (like "red") or a hex color code (like "#ff0000").
"titleBarColor"WindowsThe color of the dialog's title bar.
"titleBarHeight"WindowsThe height, in display units, of the dialog's title bar.
"keyboard"AndroidIf true, the soft keyboard is brought to the forefront when the dialog is shown.
Exceptions
The action does not throw exceptions.
Example (HTML + JavaScript)
This example uses the asynchronous version of UI.setDisplayOptions to ensure that the action does not block the current thread:
<script>
    const CS = new CSProActionInvoker();

    // get the initial display options
    const displayOptions = CS.UI.getDisplayOptions();

    // if the user has not provided an explicit width and height, size the dialog
    // to 100% of the available width and 50% of the available height
    if( !displayOptions.width || !displayOptions.height ) {
        displayOptions.width = "100%";
        displayOptions.height = "50%";

        // size the dialog by setting the display options
        CS.UI.setDisplayOptionsAsync(displayOptions);
    }
</script>
See also: UI Action Invoker Namespace, UI.setDisplayOptions Action