🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all the hot features!
Get Free Trial

How to Reload Data

Cleyton Barroso asked on March 24, 2017

How do I make the component rerun the query in my database?
I’m creating the component this way:

var pivot = $("#pivotContainer-@idCube").flexmonster({
componentFolder: "/Content/js/flexmonster/",
global: {
localization: "loc/pr.json"
toolbar: true,
beforetoolbarcreated: customizeToolbar,
licenseKey: "@ConfigurationManager.AppSettings["flexMonsterKey"]"

var cubeOptions.dataSource = {
dataSourceType: "ocsv",
/* URL to the Data Compressor .NET */
filename: "localhost:1234/api/Cube/GetCube?cubeId=1"


Once created, I want to have the option to run the query again on my webApi and return the data again.

3 answers

Dmytro Zvazhii Dmytro Zvazhii Flexmonster March 27, 2017

Hello Cleyton,
Thank you for your question. If you need to update the data after the component is created you can use our updateData() API call – http://www.flexmonster.com/api/updatedata/. Here is the jsFiddle example for you – http://jsfiddle.net/flexmonster/xf5rn80j/.
Please let us know if it works for you.
Best regards,

Cleyton Barroso March 27, 2017

Hello Dmytro, 
Tank you for you help!
I tried to update as follows:

dataSourceType: 'ocsv',
filename: 'http://myapi.net/getCube'});

But data refresh not execute;

Dmytro Zvazhii Dmytro Zvazhii Flexmonster March 27, 2017

Hello Cleyton, 
Thank you for your quick reply. Could please check what your request http://myapi.net/getCube returns? Can the component load the data from this request during the initialization process? Also, please check if there are any stack trace errors in the console window(ctrl+shift+i).
Best regards,

Please login or Register to Submit Answer