refresh pivot table with new dataset

Hi all,
How can I update a pivot table with a new dataset and maintain its state?
thanks for your help

Hello,
After data reloading, configured rows will get new unique IDs
If data is static, it’s possible to reach the inner datatable and use the setState()/getState() API, it will work as well as they do for the ui.treetable.

var state = $$("pivot").$$("data").getState();
/* . . . */
 
$$("pivot").$$("data").refreshColumns();
$$("pivot").$$("data").setState(state);

But there’s another important note:
treetable’s get/setState works only for the same grid, i.e within one Pivot’s configuration.

Hi Nastja, thank you for your quick answer,
The following function is working well in datatable but not in a pivot one, how can I assign a new calculated data to the pivot table?
$$(“pivot”).parse(webix.copy(data));

Hi,
How can I refresh data on V9.0 Pro?

How can I refresh data on V9.0 Pro?

It is possible to reload data in the following manner: Code Snippet.

The built-in clearAll() method completely resets the stored data and any related settings (so it resets the Pivot structure in its entirety, basically), while the actual data refresh is performed by calling the getData() method of the Local service with the force flag active (see our docs for more info).

Please note that clearAll() method has been introduced with Webix 9.1.4, so the above example may not work for you if you are using an older version (like the aforementioned 9.0 version). In such cases you can try the following workaround: Code Snippet.

If you need to change the source URL to some other URL, then it can be done through the Backend service customization, something like: Code Snippet.