Migration guide from 2.9 to 3.0

This guide helps you migrate from version 2.9 to 3.0, as well as summarizes the breaking changes and new features in the 3.0 major version.

Update Flexmonster to 3.0 and then check out the following sections:

To see which features are planned to be implemented, check out the Roadmap.

Update Flexmonster

To use version 3.0, update imports depending on how you used version 2.9: from CDN or ZIP package.

Backward compatibility

This section covers backward compatibility between the old and new versions. After updating Flexmonster, your existing implementation will continue to work.

Legacy initialization

For backward compatibility, the legacy initialization through new Flexmonster() is still supported: after updating flexmonster.js and flexmonster.css, the Flexmonster control will be created.

See how to update imports to use version 3.0.

Report conversion

Flexmonster will automatically convert reports created in version 2.9 into the new 3.0 configuration format. Note that only implemented configurations will be applied. See the Implemented features list.

API compatibility

The existing API remains functional, except for methods that have not been implemented yet. Learn more in the Implemented features.

Also, note that the names of some methods have been updated. See the Changes in method names section for details.

Styling and customization

While the JavaScript logic is backward compatible, styling and customizations are not. You need to manually update the following:

Updates

The following sections describe the updates introduced in Flexmonster 3.0, including changes to initialization, structure of configuration objects, API methods, and supported data types.

Initialization

Starting from version 3.0, Flexmonster initialization is done via the static fm3.Controls.Flexmonster() method.

The method has two parameters: container and params. The params parameter describes configurations and is defined by BaseInputParamsObject.

Report deprecation and API updates

In version 2.9 API, the report is the primary way to configure the component. It contains the data source, the slice, options, and other settings.

Now, configurations for the component are stored in the state and options objects of the BaseInputParamsObject.

See the following tables for details on where the report properties were relocated:

Data source configurations
Version 2.9Version 3.0
report.dataSourcestate.dataset.dataSource
report.dataSource.typestate.dataset.dataSource.type
report.dataSource.datastate.dataset.dataSource.data
report.dataSource.urlstate.dataset.dataSource.url
report.dataSource.filenamestate.dataset.dataSource.url
report.dataSource.indexstate.dataset.dataSource.name
report.dataSource.mappingstate.dataset.dataSource.mapping
report.dataSource.mapping.<unique_name>.captionstate.dataset.dataSource.mapping.<unique_name>.caption
report.dataSource.mapping.<unique_name>.typestate.dataset.dataSource.mapping.<unique_name>.type
report.dataSource.requestHeadersstate.dataset.dataSource.requestHeaders
report.dataSource.withCredentialstate.dataset.dataSource.withCredential
report.dataSource.fieldSeparatorstate.dataset.dataSource.parserConfig.delimiter
report.dataSource.thousandsSeparatorDeprecated
Slice configurations
Version 2.9Version 3.0
report.slicestate.slice
report.slice.rowsstate.slice.rows, state.slice.fields (for the flat table)
report.slice.columnsstate.slice.columns, state.slice.fields (for the flat table)
report.slice.measuresstate.slice.values
report.slice.rows.uniqueName, report.slice.columns.uniqueName, report.slice.measures.uniqueNamestate.slice.rows.name, state.slice.columns.name, state.slice.values.name, state.slice.fields.name (for the flat table)
report.slice.measures.aggregationstate.slice.values.aggregation, state.slice.fields.aggregation (flat table)
report.slice.flatOrderDeprecated
Options configurations
Version 2.9Version 3.0
report.optionsoptions
report.options.viewTypeDeprecated
report.options.gridoptions.flatTable, options.pivotTable
report.options.grid.typeoptions.viewType
report.options.grid.showHeadersoptions.flatTable.showSheetHeaders, options.pivotTable.showSheetHeaders
report.options.grid.grandTotalsPositionoptions.flatTable.grandTotalsPosition
report.options.showFieldListSearchoptions.flatFieldList.showSearch, options.pivotFieldList.showSearch

Changes in method names

Some API method names have changed in version 3.0. Your old code will still work, but if you want to fully switch to the new version, update the following method names:

Version 2.9Version 3.0
closeFieldsList()closeFieldList()
getSelectedCell()getSelectedCells()
openFieldsList()openFieldList()

See the Implemented features section to check which API calls are supported in 3.0.

Changes in data types

There have also been some changes to data types:

  1. Previously, all numeric data was categorized under a single number type. In version 3.0, this type was split into two independent types:

    • integer — Use this type for whole numbers without decimals.

    • float — Use this type for numbers with fractional parts.

  2. The date string type was renamed to date.

See all available data types and how to set them in version 3.0.

New features

The following sections show the new features introduced in Flexmonster version 3.0.

New architecture

Version 3.0 introduces a modular architecture that separates UI controls from data and state management. The single Flexmonster component from 2.9 is now split into independent modules that can be used separately: pivot table, flat table, pivot field list, flat field list, and toolbar.

To initialize the specific part of the interface, use the respective method or HTML tag:

Flexmonster Pivot server

In Flexmonster 3.0, the Flexmonster Pivot server has been reimagined as a core part of the product. While it remains optional, we strongly recommend using it to achieve the best performance and scalability.

To use the new version, you need to install the Flexmonster server.

Also, you can migrate your existing server configurations to the new version.

State and dataset

Version 3.0 uses the StateObject to manage report configurations, with the DatasetObject acting as the data source within it.

You can share one StateObject among multiple controls, or use a single DatasetObject across several states. Any update to the state or data is automatically synchronized across all connected components.

New data types

The boolean data type was added.

Parser configurations

New settings have been added to configure data parsing:

Managing totals in the flat table

In version 3.0, you can set the visibility of a total value for each field in the flat table independently by using the showTotal property in the slice.

Implemented features

See the list of already implemented features in version 3.0.

Data sources

Slice

Options

API calls

Migration example

Example of migration from 2.9 to 3.0:

Live example