Dynamically load new pivot table data

I want to dynamically load data into the pivot table using javascript based on some user inputs. However, when I change the url, it appends the data to the pivot table instead of replacing the original data. Is there some way I can clear the current data before loading the new url?

Hello,

Yes, you can call clearAll method:

pivot.clearAll();

pivot.load(url);

Thanks Maria, I’ll give it a try

Hi Maria

When I use it like this:
$$(“pivot”).clearAll();
I get a message in the console that clearAll is not a function.

If I remove the clearAll command and just use this:
$$(“pivot”).load(my_url);
it just appends the data

What do you suggest?

I just found the solution from this post:
http://forum.webix.com/discussion/2384/render-pivot-chart-with-new-data

It should be $$(“pivot”).data.clearAll();

Thanks

Hi,

Sorry for posting the wrong solution. Pivot does not allow to call methods of its DataStore directly. We will add this improvement into the next version.

Great, looking forward