Flexmonster MCP Server is here! Connect your ✨AI assistant to our documentation. Get started
+

How to Reload Data

Answered
Cleyton.B. Cleyton Barroso asked on March 24, 2017

Hello!
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"
}

pivot.setReport(cubeOptions);

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

3 answers

Public
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,
Dmytro.

Public
Cleyton.B. Cleyton Barroso ⋅ March 27, 2017

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

 flexmonster.updateData(
{
dataSourceType: 'ocsv',
filename: 'http://myapi.net/getCube'});
}

But data refresh not execute;
 
 
 
 

Public
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,
Dmytro.

Please sign in or register to submit your answer