Pivot Grid (complex widgets)

Hello webix xperts !

What is the best approach to pass data to Pivot Grid custom backend ?
I have my own class which extends ‘pivot.services.Backend’
It works okay, I’ve already written ‘data()’ method which fills pivot with table.
So far, so good.

However, I would like to pass some data to pivot.services.Backend

I thought that instead of that:

        const pivot = {
            view:"pivot",
            override: new Map([[pivot.services.Backend, ReportsPivotBackend]]),
            structure: {}
        };

I can do that:

        const pivot = {
            view:"pivot",
            override: new Map([[pivot.services.Backend, new ReportsPivotBackend(someKindOfAdditionalData)]]),
            structure: {}
        };

But sadly this does’t work at all.
I get:

this.dynamic(...) is not a constructor

Hello @michald1986 ,

An instance for of class for a service or a view will be created during application initialization. Based of this fact, in the ‘override’ property you should send class itself.

The data you want to return you need to define in data() function: Code Snippet

Yes, I understand the whole concept. I already configured pivot.backend and data() function works as expected.
Problem is I wanted to pass some additional variables to data() function.
And I just don’t know what would be the best approach

The Pivot built as modularized apps on Webix Jet, and the you can customize existing modules or add new ones.
Modules are implemented as JetViews (ES6 classes) where any UI element, data-related service, or feature can be customized by the same rules.
Please note that complex modifications may require observing the source code of the tool in order to build the most feasible solution that will correctly alter/extend the original logic.

In your question there are two different ways to solve it:
a. You can pass any parameters just inside data(). Snippet with example is here
b. You can override any existing method (getData() in your case) but with a caution. In documentation you will find steps how to create your own class and how to override the Map. Snippet with expample is here