☝️Small business or a startup? See if you qualify for our special offer.
+
All documentation
Connecting to data source

Global configurations

This guide shows how to specify configurations that will be common for all reports. You can configure the following:

To apply global configs, use the GlobalObject, which can be considered as a global parent report:

const pivot = new Flexmonster({
container: "pivot-container",
global: {
// Global configs
}
// Other configs
});

Specify a global data source

To specify a data source for all reports, configure the global.dataSource property:

global: {
  dataSource: {
    filename: "https://cdn.flexmonster.com/data/data.csv"
  }
}

Live example

For more info about available data source configurations, see the DataSourceObject.

Specify global options

To specify options for all reports, configure the global.options property. 

The following example demonstrates how to specify the readOnly option for all reports:

global: {
  options: {
    readOnly: true
  }
}

Live example

In the next example, we apply date and time formatting for all reports using the datePattern option:

global: {
  options: {
    datePattern: "'Date: 'MM/dd/yy"
  }
}

Live example

Read more about available options in the Options guide.

Specify a global localization

To specify a localization for all reports, configure the global.localization property:

global: {
localization: "https://cdn.flexmonster.com/loc/es.json"
}

Live example

To learn more about localization, read the Localizing the component guide.

Global vs. report-specific configurations

If a configuration is set both in the global settings and inside the report, the report-specific value will override the global one. For example, check out the following Flexmonster configuration:

const pivot = new Flexmonster({
container: "pivot-container",
global: {
options: {
readOnly: true
},
},
report: {
dataSource: {
filename: "data/data.json"
},
options: {
readOnly: false
}
}
});

As a result, options.readOnly is set to false, and the report remains interactive.

Live example

See also