Need a special offer?Find out if your project fits.
+
All documentation
API reference
  • API Reference for older versions
  • OptionsObject

    The OptionsObject is used to specify the appearance and functionality available for users. Learn more in this guide on options.

    Get the OptionsObject via getOptions() API call. Set this object via setOptions().

    Properties

    options: {
      viewType: string,
      grid: GridOptionsObject,
      chart: ChartOptionsObject,
      filter: {
        weekOffset: number,
        dateFormat: string,
        liveSearch: boolean
      },
      configuratorActive: boolean,
      configuratorButton: boolean,
      showAggregations: boolean,
      showCalculatedValuesButton: boolean,
      showEmptyValues: boolean | string,
      editing: boolean,
      drillThrough: boolean,
      showDrillThroughConfigurator: boolean,
      sorting: string,
      readOnly: boolean,
      strictDataTypes: boolean,
      distinguishNullUndefinedEmpty: boolean,
      defaultDateType: string,
      datePattern: string,
      dateTimePattern: string,
      timePattern: string,
      dateTimezoneOffset: number,
      saveAllFormats: boolean,
      showDefaultSlice: boolean,
      useOlapFormatting: boolean,
      showMemberProperties: boolean,
      showEmptyData: boolean,
      defaultHierarchySortName: string,
      showOutdatedDataAlert: boolean,
      expandExecutionTimeout: number,
      showAggregationLabels: boolean,
      showAllFieldsDrillThrough: boolean,
      showFieldListSearch: boolean,
      useCaptionsInCalculatedValueEditor: boolean,
      validateFormulas: boolean,
      caseSensitiveMembers: boolean,
      simplifyFieldListFolders: boolean,
      validateReportFiles: boolean,
      fieldListPosition: string,
      allowBrowsersCache: boolean
    }
    Property/Type Description
    viewType
    String
    optional The type of view to show: "grid" or "charts" or "grid_charts".
    Default value: "grid".
    grid
    GridOptionsObject
    optional Contains information about the grid.
    chart
    ChartOptionsObject
    optional Contains information about charts.
    filter
    Object
    optional Contains filtering options.
    filter.weekOffset
    Number
    optional Sets amount of days to be added to the start of the week (Sunday). Used to adjust the first day of the week in the filter's calendar.
    Default value: 1 (Monday is the first day of the week).
    filter.dateFormat
    String
    optional Date pattern to format dates in filter's date inputs. Has two possible values: "dd/MM/yyyy" and "MM/dd/yyyy".
    Default value: "dd/MM/yyyy".
    filter.liveSearch
    Boolean
    optional Indicates whether the search in the filter pop-up window is performed while the user types (true) or requires the Enter button to start searching (false).
    Default value: true.
    configuratorActive
    Boolean
    optional Indicates whether the Field List is opened (true) or closed (false) after the component is initialized.
    To change this option’s value at runtime, use setReport().
    Default value: false.
    configuratorButton
    Boolean
    optional Indicates whether the Field List toggle button is visible (true) or not (false).
    Default value: true.
    showAggregations
    Boolean
    optional Indicates whether the aggregation selection control is visible (true) or not (false) for measures on the Field List.
    Default value: true.
    showCalculatedValuesButton
    Boolean
    optional Controls the visibility of “Add calculated value” in the Field List.
    Default value: true.
    showEmptyValues
    Boolean | String
    optional Specifies where to show members with empty values on the grid and charts: in rows ("rows"), in columns ("columns"), in rows and columns (true), or not at all (false).
    To configure this behavior for a specific field, use the showEmptyValues property in the mapping.
    Only for "json", "csv", and "api" data source types.
    Note that for the "api" data source type, this property has usage specifics for multilevel hierarchies: Default value: false.
    editing
    Boolean
    optional Indicates whether the editing feature is enabled (true) or disabled (false). Editing is available only in the drill-through view and the flat form. 
    If the editing feature is enabled, the user will be able to double-click the cell and enter a new value into it.
    Only for "json" and "csv" data source types.
    Default value: false.
    drillThrough
    Boolean
    optional Indicates whether the drill-through feature is enabled (true) or disabled (false). The user can drill through by double-clicking the cell with a value.
    Default value: true.
    showDrillThroughConfigurator
    Boolean
    optional Indicates whether the Field List toggle button is visible in the drill-through view.
    Only for "csv", "json", "api","microsoft analysis services" (for Flexmonster Accelerator), and "elasticsearch" data source types.
    Default value: true.
    sorting
    String
    optional Indicates whether the sorting controls are visible in rows ("rows"), in columns ("columns"), in rows and columns ("on" or true) on the grid cells, or not visible at all ("off" or false).
    Default value: "on".
    readOnly
    Boolean
    optional When set to true, enables the read-only mode for the component.
    In the read-only mode, you cannot interact with the report via UI (e.g., the context menu, expands, and drills are disabled). In addition, configurations of the following options are ignored: grid.showFilter, grid.dragging, chart.showFilter, chart.showMeasures, configuratorButton, drillThrough, and sorting.
    We also suggest hiding the Toolbar when using the read-only mode.
    Default value: false.
    strictDataTypes
    Boolean
    optional When set to true, the component treats fields marked as a measure only as measures and does not allow using them as hierarchies. This allows increasing data analyzing speed. To mark a field as a measure, set its isMeasure property in the mapping to true. Check out an example.
    Only for the "json" data source type.
    To change this option’s value at runtime, use setReport().
    Default value: false.
    distinguishNullUndefinedEmpty
    Boolean
    optional Allows distinguishing null, undefined, and empty values. When set to false, the component treats null, undefined, and empty values as the same value. When set to true, there are three different values.
    To change this option’s value at runtime, use setReport().
    Default value: false.
    defaultDateType
    String
    optional Used to specify which data types should be applied to date fields by default ("date", "date string", "year/month/day", "year/quarter/month/day" or "datetime"). Only for "json" and "csv" data source types.
    To change this option’s value at runtime, use setReport().
    Default value: "date".
    datePattern
    String
    optional Allows specifying how the component displays fields of the "date string" type. Learn more about date and time formatting.
    Only for "json", "csv", "api", and "elasticsearch" data source types.
    This property is ignored for measures when exporting a report to Excel.
    Default pattern string: "dd/MM/yyyy".
    dateTimePattern
    String
    optional Allows specifying how the component displays fields of the "datetime" type. Learn more about date and time formatting.
    Only for "json", "csv", and "api" data source types.
    This property is ignored for measures when exporting a report to Excel.
    Default pattern string: "dd/MM/yyyy HH:mm:ss".
    timePattern
    String
    optional Allows specifying how the component displays fields of the "time" type. Learn more about date and time formatting.
    Only for "json", "csv", and "api" data source types.
    This property is ignored for measures when exporting a report to Excel.
    Default pattern string: "HH:mm:ss".
    dateTimezoneOffset
    Number
    optional Allows setting a time zone for all date fields in the dataset. The dateTimezoneOffset is a number that represents the difference in hours between the needed time zone and UTC. See an example on JSFiddle.
    Besides, you can also set time zones for fields of a certain type and specific fields. These time zones will have different priorities. Learn more in our guide.
    To change this option’s value at runtime, use setReport().
    saveAllFormats
    Boolean
    optional If there are more than 20 formats defined, only the formats that are used for "active: true" measures will be saved in the report. In order to save all the formats, set the saveAllFormats property to true.
    Default value: false.
    showDefaultSlice
    Boolean
    optional Defines whether the component selects a default slice for a report with an empty slice (when nothing is set in rows, columns, report filters, and measures). If true, the first hierarchy from data goes to rows and the first measure goes to columns in the default slice. To avoid this default behavior, set this property to false.
    Only for "csv" and "json" data source types.
    To change this option’s value at runtime, use setReport().
    Default value: true.
    useOlapFormatting
    Boolean
    optional Indicates whether the values from data source will be formatted according to the format defined in the cube (true) or not (false).
    Default value: false.
    showMemberProperties
    Boolean
    optional Indicates whether the member properties for an OLAP data source are available in the component (true) or not (false).
    Only for the "microsoft analysis services" data source type.
    To change this option’s value at runtime, use setReport().
    Default value: false.
    showEmptyData
    Boolean
    optional Indicates how the component behaves for the following data sources:
    • An empty JSON/CSV file.
    • An empty JSON array.
    • A CSV file where only the header row is defined.
    • An OLAP cube that returns empty data.
    When showEmptyData is set to true, an empty grid is shown for such data sources. When set to false, the component displays a pop-up error message and triggers one of the following events:
    • dataerror for "json" and "csv" data source types.
    • queryerror for the "microsoft analysis services" data source type.
    See an example on JSFiddle.
    To change this option’s value at runtime, use setReport().
    Default value: true.
    defaultHierarchySortName
    String
    optional The sorting type for hierarchies’ members ("asc", "desc", or "unsorted").
    To change this option’s value at runtime, use setReport().
    Default value: "asc".
    showOutdatedDataAlert
    Boolean
    optional Setting this value to true will show a warning to the user before automatic reloading of data from the cube. When set to false, there is no warnings.
    Only for Flexmonster Accelerator.
    Default value: false.
    expandExecutionTimeout
    Number
    optional Allows specifying an execution timeout for the expandAllData() function.
    The timeout is set in milliseconds (i.e., 9000 equals 9 seconds). The minimum timeout value is 9000. Note that a large execution timeout can cause an unresponsive script alert.
    Default value: 9000.
    showAggregationLabels
    Boolean
    optional Indicates whether aggregation labels like "Total Sum of", "Sum of", etc. are shown in the column/row titles.
    Default value: true.
    showAllFieldsDrillThrough
    Boolean
    optional Indicates whether prefiltering the drill-through view columns is enabled (false) or the drill-through view displays all the available columns (true) when using SSAS with Flexmonster Accelerator.
    Default value: false.
    showFieldListSearch
    Boolean
    optional Indicates whether the search bar in the Field List is shown (true) or hidden (false). When the search bar is hidden, it will be shown only in case the number of the hierarchies exceeds 50 (40 for the flat form).
    Default value: false.
    useCaptionsInCalculatedValueEditor
    Boolean
    optional By default, Flexmonster uses field unique names in the calculated value editor. If useCaptionsInCalculatedValueEditor is set to true, the component will use field captions instead of unique names.
    Default value: false.
    validateFormulas
    Boolean
    optional Indicates whether the validation is performed for calculated values (true) or not (false). In case the validation is turned on and the report contains invalid formula, the "Wrong formula format" alert message is shown.
    To change this option’s value at runtime, use setReport().
    Default value: true.
    caseSensitiveMembers
    Boolean
    optional Indicates whether the hierarchies' members are case-sensitive (true) or not (false).
    To change this option’s value at runtime, use setReport().
    Default value: false.
    simplifyFieldListFolders
    Boolean
    optional Indicates whether the folders containing one field should show this field in the root (true) or not (false).
    Only for Elasticsearch and SSAS data sources.
    Default value: false.
    validateReportFiles
    Boolean
    optional Indicates whether validation of report files is turned on (true) or turned off (false). Setting this value to false allows loading report files in the old format without an error message. Should be used in global options.
    Default value: true.
    fieldListPosition
    String
    optional Indicates whether the Field List is always shown on the right ("right") or in the pop-up window (undefined).
    Default value: undefined.
    allowBrowsersCache
    Boolean
    optional Indicates whether browsers are allowed to cache the data (true) or not (false). When allowBrowsersCache is set to false, caching is not allowed, and Flexmonster appends a unique id to the data source's URL to ensure that the URL stays unique. The unique URL prevents the browser from loading the data from its cache, so the data is updated every time it is requested. Setting allowBrowsersCache to true allows caching, and the URL remains unmodified (check out an example).
    To change this option’s value at runtime, use setReport().
    Default value: false.

    See also

    Options guide
    GridOptionsObject
    ChartOptionsObject
    getOptions()
    setOptions()