We have updated WebDataRocks EULA, effective as of April 18, 2024. Learn more about what's changed.

How to use getReport() method based on container id?

Answered

I want getReport() based on container id. i’m using this in jQuery application
like $(“#wdr-component”).getReport()
instead of pivot.getReport()
 
Thanks in advance.
 
 
 

2 answers

WebDataRocks Team WebDataRocks April 2, 2020

Hello, Ezhumalai,
 
Thank you for your question.
 
Our team would like to kindly inform you that API calls provided by the component can be accessed only using the direct reference to the instance of WebDataRocks.
 
Therefore, the only options to access the getReport method are specifying the name of the variable to which the instance is assigned (e.g., “pivot”), or the reference to the latest created instance – “webdatarocks”.
 
We hope it helps.
Please contact us in case of additional questions.
 
Best regards,
WebDataRocks Team

WebDataRocks Team WebDataRocks April 13, 2020

Hello, Ezhumalai,
 
It seems we have found a way to fulfill your request.
 
In order to use a component’s API through the container id, the following structure can be used:

$("#wdr-component").data("webdatarocks").getReport()

The getReport() method can be replaced with any available method provided by WebDataRocks.
 
Please note that in order to use API in the way described above, the instance of the component should be created using jQuery as well. For example:

var pivot = $("#wdr-component").webdatarocks({
container: "#wdr-component",
toolbar: true,
height: 490,
report: {
...
}
});

You are welcome to find out an example we have prepared for you.
 
More useful information about integration with jQuery in our documentation.
 
We hope it helps.
 
Kind regards,
WebDataRocks Team