We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.
All documentation
  • API Reference for older versions
  • ready

    [starting from version: 2.3]

    It is triggered when the component's initial configuration is completed and the component is ready to receive API calls. Please note that Flexmonster API calls cannot be called until the ready event is triggered. In other words, when the ready handler is called, you know that the component was created and now you can use API calls.

    Note that some API calls work correctly only after the report is loaded, which might not happen by the time the ready event is triggered. Use the reportcomplete event to work with such API calls. See the list of API calls that require the report to be loaded.

    To track changes in the ReportObject, use the reportchange event.

    Example

    Defining a report from JS after the component is created:

    const pivot = new Flexmonster({
    container: "pivotContainer",
    componentFolder: "node_modules/flexmonster/",
    toolbar: true,
    ready: () => {
    const report = {
    dataSource: {
    filename: "data.csv"
    },
    options: {
    grid: {
    title: "Report set via JS API"
    }
    },
    slice: {
    rows: [
    {uniqueName: "Country"},
    {uniqueName: "[Measures]"}
    ],
    columns: [
    {uniqueName: "Color"}
    ],
    measures: [
    {uniqueName: "Price"}
    ]
    }
    };
    pivot.setReport(report);
    }
    });

    Live example

    See also

    Flexmonster
    reportcomplete
    reportchange