Need a special offer?Find out if your project fits.
+

Angular data not binding to the pivotTabel

Answered
Naidu asked on June 24, 2020

Below is my code 
  
  getReportData()
  {
    let infoJSON;
    infoJSON=  this.http.get('ourApiUrl').subscribe(data => {
       console.log(data)
        
      });
      return infoJSON
    
  }
 
binding the above method to Pivot as below 
 
  public pivotReport = {
dataSource: {
    dataSourceType: "json",
    date:this.getReportData()
}
..
...
.....
  };
 
HTML:
<fm-pivot #pivot 
[toolbar]="true" 
[width]="'100%'" 
[height]="500" 
  [report]="pivotReport"
  [customizeCell]="onCustomizeCell"
  (ready)="onPivotReady($event)"
  (beforetoolbarcreated)="customizeToolbar($event)">
</fm-pivot>

4 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 25, 2020

Hello, Naidu,
 
Thank you for reaching out to us.
 
Our team would like to kindly note that the data property of the dataSource object should be used in order to use inline JSON as a data source. In your code snippet, the date property is used instead.
 
Please change the corresponding line of code as shown below and try establishing connection one more time:

public pivotReport = {
dataSource: {
dataSourceType: “json”,
data: this.getReportData()
},
...
};

 
Detailed information about the dataSource object and its properties can be found in our documentation.
 
Please let us know if it works for you.
Do not hesitate to contact us if additional assistance is needed.
 
Best regards,
Illia

Public
Naidu June 25, 2020

Thank you for the information,
 
We use data property only. showing the popup with jsonData is invalid

Public
Naidu June 25, 2020

This is the json data i am getting in the console

Attachments:
Capture.PNG

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 1, 2020

Hello,
 
Thank you for writing to us.
 
It seems we have answered your question in the following forum thread: https://www.flexmonster.com/question/data-not-binding-to-pivottable-in-angular/.
 
Regards,
Illia

Please login or Register to Submit Answer