Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Callback function from getData never executes

Resolved
Javier Sanz Lopez asked on July 8, 2020

Good morning.
My question is regarding the getData() function, which I use to retrieve information to create charts around my pivot table.
The code of the methods performing this actions is the following:
 

public createChart(result: FlexmonsterCreateModel, dataSource: DataSourceModel) {
    result.flexmonster.getData(
      {},
      (data, error) => this.drawChart(data, result.data, dataSource, error),
      (data, error) => this.redrawChart(data, result.data, dataSource, error),
    );
  }
 

public drawChart(data: any, result: CreateChartModel, dataSource: DataSourceModel, error: any) {
    console.log(‘dr’, data);
    console.log(‘err’, error);
    if (!this.realChartData.find(chart => chart.id === result.id)) {
      this.form.addControl(`chart-${result.id}`, new FormControl(true));
      this.realChartData.push(this.kpiReportsService.mapChartData(data, result, dataSource));
    }
    this.loading = false;
  }
 

As you can see in the attached picture, the flexmonster instance is loaded with data, as I can see the result of the query, but then the callback method drawChart is never executed.
 

Best regards.
Javier
 

Attachments:
8Jul1.png

1 answer

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster July 9, 2020

Hi Javier,
 
Thank you for posting your question and our apologies for the slightly delayed response.
 
We’ve taken a look at the provided code snippets & compared this with our samples – so far it is not exactly clear to us why the callback handler of the getData() API call is not executed.
 
In order for us to investigate this further, do you think you could provide us with a sample project where the issue is reproducible? This will help us get closer to the core of the issue and provide you with a solution much faster.
 
Looking forward to your response! 
 
Best regards,
Mykhailo

Please login or Register to Submit Answer