Need a special offer?Find out if your project fits.
+
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: {
    weekOffset: number,
    dateFormat: string,
    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, and filter.liveSearch properties. They are described below.
    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.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). See an example on JSFiddle.
    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). Check out an example on JSFiddle.
    Default value: true.
    showCalculatedValuesButton
    Boolean
    optional Specifies whether the Add calculated value button in the Field List is visible (true) or not (false). Check out an example on JSFiddle.
    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 double-click the cell and enter a new value into it. Try it on JSFiddle.
    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. See an example.
    Only for "json" and "csv" data source types.
    Default value: false.
    drillThrough
    Boolean
    optional Specifies whether the drill-through feature is enabled (true) or disabled (false). The user can drill through by double-clicking the cell with a value. Check out an example on JSFiddle.
    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.
    drillThroughMaxRowsSets 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. See an 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 treats fields marked as a measure only as measures and does not allow using them as hierarchies. This increases 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. When set to true, these are three different values.
    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"). See an 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. See an 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. Check out an 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. Check out an 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. 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 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). See an 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). See an 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.
    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 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. See an 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 (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()