All documentation
  • API Reference for older versions
  • OptionsObject

    The OptionsObject is used to configure Flexmonster’s functionality and manage UI controls. 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: {
    allowEmptyMembersFilter: boolean,
    weekOffset: number,
    dateFormat: string,
    filterByDateAndTime: boolean,
    liveSearch: boolean
    },
    configuratorActive: boolean,
    configuratorButton: boolean,
    showAggregations: boolean,
    showCalculatedValuesButton: boolean,
    showEmptyValues: boolean | string,
    editing: boolean,
    drillThrough: boolean,
    showDrillThroughConfigurator: boolean,
    drillThroughMaxRows: number,
    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/TypeDescription
    viewType
    String
    optional  The view type to show. The following view types are available: "grid", "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 Specifies options for filter pop-up window.
    The filter object has the filter.weekOffset, filter.dateFormat, filter.filterByDateAndTime and filter.liveSearch properties. They are described below.
    filter.allowEmptyMembersFilter
    Boolean
    optional By default, if the selection filter contains only members that do not exist in the dataset, Flexmonster ignores it and displays all field members. 
    To change this behavior so that an empty grid is shown instead, set filter.allowEmptyMembersFilter to true Live example.
    Only for "json" and "csv" data source types.
    This option is available in Flexmonster version 2.9.86 or later. See how to change this behavior for any data source type and Flexmonster version.
    Default value: false.
    filter.weekOffset
    Number
    optional Sets the number 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 Specifies how the component displays dates in the filter’s date inputs. Has two possible values: "dd/MM/yyyy" and "MM/dd/yyyy".
    Default value: "dd/MM/yyyy".
    filter.filterByDateAndTime
    Boolean
    optional Indicates whether the conditional filter for date fields should consider time (true) or not (false). When set to true, a time picker is added to the date picker in the filter view Live example.
    This option is available for the "datetime" and "date string" field types.
    Only for the "api" data source type.
    Default value: false.
    filter.liveSearch
    Boolean
    optional Specifies whether the search in the filter pop-up window is performed while the user types (true) or after the Enter button is pressed (false).
    Default value: true.
    configuratorActive
    Boolean
    optional Specifies 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 Specifies whether the Field List toggle button is visible (true) or not (false) Live example.
    Default value: true.
    showAggregations
    Boolean
    optional Specifies whether the sigma icon for choosing an aggregation in the Field List is visible (true) or not (false) Live example.
    Default value: true.
    showCalculatedValuesButton
    Boolean
    optional Specifies whether the Add calculated value button in the Field List is visible (true) or not (false) Live example.
    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 Specifies 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 click the cell and enter a new value into it Live example.
    Note that editing in Flexmonster does not affect the underlying data. To apply the changes to the original dataset, track these changes using the datachanged event and apply them to your data manually Live example.
    Only for "json" and "csv" data source types.
    Default value: false.
    drillThrough
    Boolean
    optional Specifies whether the drill-through feature to show details about a value cell is enabled (true) or disabled (false). The user can drill through by double-clicking the cell with a value Live example.
    Default value: true.
    showDrillThroughConfigurator
    Boolean
    optional Specifies 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.
    drillThroughMaxRows
    Number
    optional Sets the maximum number of rows for the drill-through view.
    When set to 0, the maximum number of rows is unlimited for the Data Server.
    Only for "api""microsoft analysis services", and "elasticsearch" data source types.
    Default value: 1000.
    sorting
    String
    optional Specifies where the sorting controls are visible: in rows ("rows"), in columns ("columns"), in rows and columns ("on" or true), or not visible at all ("off" or false).
    Default value: "on".
    readOnly
    Boolean
    optional Specifies whether the read-only mode is enabled (true) or not (false).
    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 Live example.
    We also suggest hiding the Toolbar when using the read-only mode.
    Default value: false.
    strictDataTypes
    Boolean
    optional When set to true, the component restricts which fields can be selected only for measures and which fields can be selected only for rows, columns, or report filters. This increases data analyzing speed. To specify which fields can be selected only for measures, set the isMeasure mapping property to true for such fields Live example.
    Only for the "json" data source type.
    To change this option’s value at runtime, use setReport().
    Default value: false.
    distinguishNullUndefinedEmpty
    Boolean
    optional By default, the component treats null, undefined, and empty string ("") values as the same. Set this option to true, so that these values are treated distinctly Live example.
    To change this option’s value at runtime, use setReport().
    Default value: false.
    defaultDateType
    String
    optional Specifies which data types should be applied to date fields by default ("date", "date string", "year/month/day", "year/quarter/month/day", or "datetime") Live example.
    Only for "json" and "csv" data source types.
    To change this option’s value at runtime, use setReport().
    Default value: "date".
    datePattern
    String
    optional Specifies how the component displays fields of the "date string" type Live example.
    This property is ignored for measures when exporting a report to Excel.
    Only for "json", "csv", "api", and "elasticsearch" data source types.
    Default pattern string: "dd/MM/yyyy".
    Learn more about date and time formatting.
    dateTimePattern
    String
    optional Specifies how the component displays fields of the "datetime" type Live example.
    This property is ignored for measures when exporting a report to Excel.
    Only for "json", "csv", and "api" data source types.
    Default pattern string: "dd/MM/yyyy HH:mm:ss".
    Learn more about date and time formatting.
    timePattern
    String
    optional Specifies how the component displays fields of the "time" type Live example.
    This property is ignored for measures when exporting a report to Excel.
    Only for "json", "csv", and "api" data source types.
    Default pattern string: "HH:mm:ss".
    Learn more about date and time formatting.
    dateTimezoneOffset
    Number
    optional Sets 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 Live example.
    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 By default, if over 20 number formats are defined, only the formats applied to active measures (active: true) will be saved in the report. To save all the formats, set the saveAllFormats property to true.
    Default value: false.
    showDefaultSlice
    Boolean
    optional Specifies 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). By default, the first field from data goes to rows and the first measure goes to columns. To avoid this behavior, set showDefaultSlice 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 Specifies whether the values from a data source will be formatted according to the format defined in the cube (true) or not (false) Live example.
    Only for the "microsoft analysis services" data source type.
    Default value: false.
    showMemberProperties
    Boolean
    optional Specifies whether the member properties for an OLAP data source are available in the component (true) or not (false) Live example.
    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 Specifies 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.
    Live example
    To change this option’s value at runtime, use setReport().
    Default value: true.
    defaultHierarchySortName
    String
    optional The sorting type for field members ("asc", "desc", or "unsorted").
    To change this option’s value at runtime, use setReport().
    Default value: "asc".
    showOutdatedDataAlert
    Boolean
    optional Specifies whether to show a warning before automatic reloading of data from the cube (true) or not (false). Only for Flexmonster Accelerator.
    Default value: false.
    expandExecutionTimeout
    Number
    optional Specifies 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 Specifies whether aggregation labels like "Total Sum of", "Sum of", etc. are shown in the row and column titles Live example.
    Default value: true.
    showAllFieldsDrillThrough
    Boolean
    optional Specifies whether the drill-through view displays all available columns (true) or not (false). Only for Flexmonster Accelerator.
    Default value: false.
    showFieldListSearch
    Boolean
    optional Specifies 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 when the number of fields exceeds 50 (or 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 Specifies whether validation is performed for calculated values (true) or not (false). If validation is turned on and the report contains an invalid formula, the "Wrong formula format" alert is shown.
    To change this option’s value at runtime, use setReport().
    Default value: true.
    caseSensitiveMembers
    Boolean
    optional Specifies whether the field members are case-sensitive (true) or not (false).
    To change this option’s value at runtime, use setReport().
    Default value: false.
    simplifyFieldListFolders
    Boolean
    optional Specifies whether the folders containing one field should show this field in the root (true) or not (false).
    Only for "elasticsearch" and "microsoft analysis services" data source types.
    Default value: false.
    validateReportFiles
    Boolean
    optional Specifies whether validation of report files is turned on (true) or 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 Specifies where to show the Field List: on the right ("right") or in the pop-up window (undefined).
    Default value: undefined.
    allowBrowsersCache
    Boolean
    optional Specifies whether browsers are allowed to cache the data (true) or not (false). When allowBrowsersCache is set to false, 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 whenever requested. When allowBrowsersCache is set to true, the URL is unmodified Live example.
    To change this option’s value at runtime, use setReport().
    Default value: false.

    See also

    Options guide
    GridOptionsObject
    ChartOptionsObject
    getOptions()
    setOptions()