We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Using getData to return all data without expanding the UI

Answered
Christopher Phillips asked on May 28, 2019

Is there anyway using the getData API to return all pivoted data including the collapsed data?
 
We want to have access to all the raw data without having to expand all collapsed data.

7 answers

Public
Christopher Phillips May 28, 2019

If at all possible an optional parameter ex: getData(allData: true) would be great!

Public
Vera Didenko Vera Didenko Flexmonster May 30, 2019

Hello, Christopher,
 
Thank you for writing to us.
 
We would like to confirm that the getData() API call can be used to return all pivoted data including the collapsed data.
You can define a separate slice (which will not be shown on the grid) and pass it to getData:
 

function getAllDataFromGrid(){

// get the current report
var report = pivot.getReport();

// get the currently displayed slice and set expands and drills
var slice = report.slice;
slice.expands = {expandAll: true};
slice.drills = {drillAll: true};


pivot.getData({slice:slice}, function(data){
console.log(data)
});
}

Here is a JSFiddle for illustration.
 
Please let us know if this works for you.
 
Best Regards,
Vera

Public
Christopher Phillips June 7, 2019

Thanks for the response Vera that does work for us but I think we might be pushing the limits just a little bit.  I used to your fiddle and connected it to a local CSV with 50,000 rows and 12 columns. Through some testing in the fiddle I found that getData breaks if you build a pivot that has more than 4 columns and 4 rows. If you do specify 4 columns and 4 rows getData returns an array > 5,000,000 but if you specify more rows or cols the browser crashes. We were wondering if there was a way for getData to fail more gracefully if the data set is to large. 
 
I've attached the test dataset.

Attachments:
public_complaints.csv

Public
Vera Didenko Vera Didenko Flexmonster June 10, 2019

Hello, Christopher,
 
Thank you for bringing this to our attention and for providing test data.
 
Our team will look into this in more detail and we will notify you about the result of our research with the ETA 15th of July.
 
Please let us know if you have further questions.
 
Best Regards,
Vera

Public
Christopher Phillips July 16, 2019

Hi Vera any update on this?

Public
Tanya Gryshko Tanya Gryshko Flexmonster July 16, 2019

Hello, Christopher,
We are glad to inform you that now getData() API call gets terminated with the error message in the callback when it can possibly crash the web page.
This is provided in the 2.7.10 version of Flexmonster: https://www.flexmonster.com/release-notes/.
You are welcome to update the component.
Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
Feel free to write to us in case of questions.
Best Regards,
Tanya

Public
Vera Didenko Vera Didenko Flexmonster July 31, 2019

Hello, Christopher,
 
We would like to inform you that the getData() signature was changed.
Now callbackHandler and updateHandler get two input parameters: rawData and error
error is returned only for cases getData() API call gets terminated when it can possibly crash the web page.
 
This is available in the 2.7.11 version of Flexmonster: https://www.flexmonster.com/release-notes/.
 
You are welcome to update the component.
Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
 
Please let us know if everything works fine for you.
 
Best Regards,
Vera

Please login or Register to Submit Answer